summaryrefslogtreecommitdiffstats
path: root/ansible/roles
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2018-12-20 07:53:10 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-20 07:53:10 +0000
commitaa47af8c76d1324707c66e4746d95ecf61d49cf3 (patch)
tree792d06ca775e13bd1e4a183bdbb75cf453b52689 /ansible/roles
parenta1d3e82d9094a1b0947c2ab154c8f8c3e217adfb (diff)
parentb88839455d4f01a85a0859d896fc8bebfe620aa7 (diff)
Merge "Add ansible firewall role"
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/firewall/tasks/firewall-disable.yml17
-rw-r--r--ansible/roles/firewall/tasks/main.yml2
2 files changed, 19 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
diff --git a/ansible/roles/firewall/tasks/main.yml b/ansible/roles/firewall/tasks/main.yml
new file mode 100644
index 00000000..f7bb7c74
--- /dev/null
+++ b/ansible/roles/firewall/tasks/main.yml
@@ -0,0 +1,2 @@
+---
+- include_tasks: "firewall-{{ state }}.yml"