summaryrefslogtreecommitdiffstats
path: root/ansible/roles/firewall/tasks/firewall-disable.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/firewall/tasks/firewall-disable.yml')
-rw-r--r--ansible/roles/firewall/tasks/firewall-disable.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/ansible/roles/firewall/tasks/firewall-disable.yml b/ansible/roles/firewall/tasks/firewall-disable.yml
new file mode 100644
index 00000000..9a8a2c10
--- /dev/null
+++ b/ansible/roles/firewall/tasks/firewall-disable.yml
@@ -0,0 +1,17 @@
+---
+- name: Check if firewalld is installed
+ yum:
+ list: firewalld
+ disablerepo: "*"
+ register: firewalld_check
+
+- name: Stop and disable firewalld if exists
+ service:
+ name: firewalld
+ state: stopped
+ enabled: no
+ when: firewalld_check.results|selectattr('yumstate', 'match', 'installed')|list|length != 0
+
+- name: Flush iptables
+ iptables:
+ flush: true