Role 2.5.1 fails when zabbix_agent2_listenport is undefined
Thulium-Drake opened this issue · comments
SUMMARY
Role fails when zabbix_agent2_listenport is undefined
ISSUE TYPE
- Bug Report
COMPONENT NAME
zabbix_agent role
ANSIBLE VERSION
ansible [core 2.16.5]
config file = None
configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/ansible/.local/share/pipx/venvs/ansible-core-2-16/lib64/python3.12/site-packages/ansible
ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
executable location = /home/ansible/.local/bin/ansible
python version = 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 14.0.1 20240411 (Red Hat 14.0.1-0)] (/home/ansible/.local/share/pipx/venvs/ansible-core-2-16/bin/python)
jinja version = 3.1.3
libyaml = True
EXPECTED RESULTS
ACTUAL RESULTS
TASK [community.zabbix.zabbix_agent : API | Create a new host or update an existing host's info] ********************
fatal: [myhost -> monitoring.example.nl]: FAILED! =>
msg: |-
The task includes an option with an undefined variable. The error was: [{'type': 1, 'main': 1, 'useip': '{{ zabbix_useuip }}', 'ip': '{{ zabbix_agent_ip }}', 'dns': '{{ ansible_fqdn }}', 'port': '{{ (zabbix_agent2 == True) | ternary(zabbix_agent2_listenport, zabbix_agent_listenport) }}'}]: 'zabbix_agent2_listenport' is undefined. 'zabbix_agent2_listenport' is undefined. [{'type': 1, 'main': 1, 'useip': '{{ zabbix_useuip }}', 'ip': '{{ zabbix_agent_ip }}', 'dns': '{{ ansible_fqdn }}', 'port': '{{ (zabbix_agent2 == True) | ternary(zabbix_agent2_listenport, zabbix_agent_listenport) }}'}]: 'zabbix_agent2_listenport' is undefined. 'zabbix_agent2_listenport' is undefined
The error appears to be in '/home/ansible/projects/stuff/collections/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/api.yml': line 14, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: "API | Create a new host or update an existing host's info"
^ here