From 6b86df9d56091aeff21e68280c8da317aac4bce0 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 3 Dec 2021 13:41:44 +0100 Subject: [PATCH] firewall rules only when firewalld is enabled. --- tasks/zabbix-agent_firewalld_rules.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/zabbix-agent_firewalld_rules.yml b/tasks/zabbix-agent_firewalld_rules.yml index 094e955..4321596 100644 --- a/tasks/zabbix-agent_firewalld_rules.yml +++ b/tasks/zabbix-agent_firewalld_rules.yml @@ -2,7 +2,13 @@ - name: Manage the zabbix agent firewalld rules block: - name: Manage the zabbix agent firewall services - firewalld: service={{ item.service }} zone={{ item.zone }} permanent={{ item.permanent | default(True) }} state={{ item.state }} immediate=True + firewalld: + service: '{{ item.service }}' + zone: '{{ item.zone }}' + permanent: '{{ item.permanent | default(True) }}' + state: '{{ item.state }}' + immediate: True with_items: '{{ zabbix_agent_firewalld_services }}' + when: firewalld_enabled tags: [ zabbix', 'zabbix_agent', 'firewall', 'firewalld', 'iptables', 'iptables_rules' ] -- 2.17.1