-
Notifications
You must be signed in to change notification settings - Fork 336
Description
SUMMARY
Trying to create a new template.
The job fails because is not able to get the correct groupid from templates_group.
It seems that is going to retrieve a host group groupid instead of the templates group groupid.
ISSUE TYPE
- Bug Report
COMPONENT NAME
module: community.zabbix.zabbix_template module
ANSIBLE VERSION
ansible [core 2.19.4]
config file = None
configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.13.5 (main, Jun 25 2025, 18:55:22) [GCC 14.2.0] (/usr/bin/python3)
jinja version = 3.1.6
pyyaml version = 6.0.2 (with libyaml v0.2.5)
CONFIGURATION
CONFIG_FILE() = None
GALAXY_SERVERS:
OS / ENVIRONMENT / Zabbix Version
zabbix-server 6.2
STEPS TO REPRODUCE
Step 1)
Creta the template group manually from zabbix GUI
TESTPA_template_group
step2)
run the playbook to generate a new template and assign it to the template group created in step 1.
- get the error:
[ERROR]: Task failed: Module failed: Template group not found: TESTPA_template_group
Origin: /home/user/ansible-playbooks/zabbix-demo/bugreported/bug_test.yaml:20:7
18 tasks:
19
20 - name: Create TEST Zabbix template
^ column 7
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"clear_templates": null,
"http_login_password": null,
"http_login_user": null,
"link_templates": null,
"macros": null,
"state": "present",
"tags": null,
"template_groups": [
"TESTPA_template_group"
],
"template_json": null,
"template_name": "Test Template",
"template_xml": null,
"template_yaml": null
}
},
"msg": "Template group not found: TESTPA_template_group"
}
-
name: Create Zabbix Host Group
hosts: localhost
gather_facts: falsevars:
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_host: your.zabbix.server
ansible_user: "username_with_privileges"
ansible_httpapi_pass: "*******************"collections:
- community.zabbix
tasks:
- name: Create TEST Zabbix template
community.zabbix.zabbix_template:
template_name: "TEST Template"
template_groups:
- TESTPA_template_group
link_templates:
macros:
state: present
...
EXPECTED RESULTS
ACTUAL RESULTS