Closed sblaisot closed 1 month ago
How about https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L54 https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L63 https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L82
TASK [community.zabbix.zabbix_agent : Configure Agent] *************************
included: /path/to/collections/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml for target
TASK [community.zabbix.zabbix_agent : Set default ip address for zabbix_agent_ip] ***
ok: [target]
TASK [community.zabbix.zabbix_agent : Get Total Private IP Addresses] **********
ok: [target]
TASK [community.zabbix.zabbix_agent : Set first public ip address for zabbix_agent_ip] ***
skipping: [target]
TASK [community.zabbix.zabbix_agent : Set first private ip address for zabbix_agent_ip] ***
skipping: [target]
TASK [community.zabbix.zabbix_agent : Fail invalid specified agent_listeninterface] ***
skipping: [target]
TASK [community.zabbix.zabbix_agent : Set network interface] *******************
skipping: [target]
TASK [community.zabbix.zabbix_agent : Get IP of agent_listeninterface when no agent_listenip specified] ***
skipping: [target]
TASK [community.zabbix.zabbix_agent : Default agent_listenip to all when not specified] ***
fatal: [target]: FAILED! => {"msg": "The conditional check 'not (zabbix_agent_listenip)' failed. The error was: error while evaluating conditional (not (zabbix_agent_listenip)): 'zabbix_agent_listenip' is undefined. 'zabbix_agent_listenip' is undefined\n\nThe error appears to be in '/etc/ansible/collections/ansible_collections/cozycloud/zabbix-scaleway/collections/ansible_collections/community/zabbix/roles/zabbix_agent/tasks/Linux.yml': line 68, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"Default agent_listenip to all when not specified\"\n ^ here\n"}
How about https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L54 https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L63 https://github.com/ansible-collections/community.zabbix/blob/main/roles/zabbix_agent/tasks/Linux.yml#L82
you're right, these should be fixed too.
oh no, third one is uneeded because set_fact on line 59 and 69
ok, commit updated
Thank you for PR. @pyrodie18 please review and merge.
SUMMARY
zabbix.agent role in 2.5.0 fails when
zabbix_agent_listenip is undefined
This poull request fixes the role
ISSUE TYPE
COMPONENT NAME
agent
This fixes #1244