summaryrefslogtreecommitdiffstats
path: root/ansible/test/roles
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/test/roles')
-rw-r--r--ansible/test/roles/prepare-firewall/defaults/main.yml5
-rw-r--r--ansible/test/roles/prepare-firewall/tasks/main.yml11
2 files changed, 16 insertions, 0 deletions
diff --git a/ansible/test/roles/prepare-firewall/defaults/main.yml b/ansible/test/roles/prepare-firewall/defaults/main.yml
new file mode 100644
index 00000000..b450099a
--- /dev/null
+++ b/ansible/test/roles/prepare-firewall/defaults/main.yml
@@ -0,0 +1,5 @@
+---
+firewall:
+ package_name:
+ RedHat: 'firewalld'
+ Debian: 'ufw'
diff --git a/ansible/test/roles/prepare-firewall/tasks/main.yml b/ansible/test/roles/prepare-firewall/tasks/main.yml
new file mode 100644
index 00000000..a997d14f
--- /dev/null
+++ b/ansible/test/roles/prepare-firewall/tasks/main.yml
@@ -0,0 +1,11 @@
+---
+- name: Install firewall
+ package:
+ name: "{{ firewall.package_name[ansible_facts.os_family] }}"
+ state: present
+
+- name: Start and enable firewall
+ service:
+ name: "{{ firewall.package_name[ansible_facts.os_family] }}"
+ state: started
+ enabled: true