Skip to content

Commit

Permalink
Fix agent role when zabbix_agent_listenip is undefined (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
sblaisot authored May 31, 2024
1 parent d564eba commit ad3723b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/pr_1245.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- zabbix_agent - Fix role when zabbix_agent_listenip is undefined
6 changes: 3 additions & 3 deletions roles/zabbix_agent/tasks/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
network_interface: ansible_{{ zabbix_agent_listeninterface }}
when:
- (zabbix_agent_listeninterface)
- not zabbix_agent_listenip
- zabbix_agent_listenip is undefined
tags:
- config

Expand All @@ -60,7 +60,7 @@
zabbix_agent_listenip: "{{ hostvars[inventory_hostname][network_interface]['ipv4'].address | default('0.0.0.0') }}"
when:
- (zabbix_agent_listeninterface)
- not zabbix_agent_listenip
- zabbix_agent_listenip is undefined
tags:
- config
- api
Expand All @@ -69,7 +69,7 @@
ansible.builtin.set_fact:
zabbix_agent_listenip: "0.0.0.0"
when:
- not (zabbix_agent_listenip)
- zabbix_agent_listenip is undefined
tags:
- config

Expand Down

0 comments on commit ad3723b

Please sign in to comment.