From 96a292338d66a20f70ff4f53b50d4fbc7d361fe3 Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Sat, 7 Dec 2024 14:55:25 -0500 Subject: [PATCH 1/3] zabbix_agent role: accept several IPs in `zabbix_agent_listenip` variable. --- roles/zabbix_agent/tasks/Linux.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index 99af1374b..5dedf124f 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -75,11 +75,13 @@ - name: "Fail invalid specified agent_listenip" ansible.builtin.fail: - msg: "The agent_listenip does not exist" + msg: "{{ item }} The agent_listenip does not exist" when: - - zabbix_agent_listenip != '0.0.0.0' - - zabbix_agent_listenip != '127.0.0.1' - - (zabbix_agent_listenip not in ansible_all_ipv4_addresses) + - item != '0.0.0.0' + - item != '127.0.0.1' + - item not in ansible_all_ipv4_addresses + with_items: + "{{ zabbix_agent_listenip | split(',') }}" tags: - config From 81adb3677b1efd98ca0c5d3370d03c1395221791 Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Sat, 7 Dec 2024 14:55:46 -0500 Subject: [PATCH 2/3] CHANGELOG fragment added. --- changelogs/fragments/zabbix_agent_listenip.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/zabbix_agent_listenip.yml diff --git a/changelogs/fragments/zabbix_agent_listenip.yml b/changelogs/fragments/zabbix_agent_listenip.yml new file mode 100644 index 000000000..b8d9d348f --- /dev/null +++ b/changelogs/fragments/zabbix_agent_listenip.yml @@ -0,0 +1,2 @@ +minor_changes: + - zabbix_agent role - accept several IPs in `zabbix_agent_listenip` variable. From 17145e8b302147a43281e201950a46e3acb15ab2 Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Mon, 9 Dec 2024 11:54:35 -0500 Subject: [PATCH 3/3] Fix wording. --- roles/zabbix_agent/tasks/Linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/zabbix_agent/tasks/Linux.yml b/roles/zabbix_agent/tasks/Linux.yml index 5dedf124f..d7bf1eff8 100644 --- a/roles/zabbix_agent/tasks/Linux.yml +++ b/roles/zabbix_agent/tasks/Linux.yml @@ -75,7 +75,7 @@ - name: "Fail invalid specified agent_listenip" ansible.builtin.fail: - msg: "{{ item }} The agent_listenip does not exist" + msg: "The {{ item }} (agent_listenip) does not exist" when: - item != '0.0.0.0' - item != '127.0.0.1'