aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/firewall/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'roles/firewall/tasks')
-rw-r--r--roles/firewall/tasks/main.yml22
1 files changed, 22 insertions, 0 deletions
diff --git a/roles/firewall/tasks/main.yml b/roles/firewall/tasks/main.yml
new file mode 100644
index 0000000..9fcf543
--- /dev/null
+++ b/roles/firewall/tasks/main.yml
@@ -0,0 +1,22 @@
+- name: Install iptables-persistent
+ become: true
+ ansible.builtin.apt:
+ install_recommends: false
+ name: iptables-persistent
+ state: present
+
+- name: 'Configure rules'
+ become: true
+ ansible.builtin.template:
+ src: '{{ item.src }}'
+ dest: '{{ item.dest }}'
+ owner: root
+ group: root
+ mode: '640'
+ loop:
+ - {src: rules.v4, dest: /etc/iptables/rules.v4}
+ - {src: rules.v6, dest: /etc/iptables/rules.v6}
+ notify: Reload iptables
+
+- name: Flush handlers
+ ansible.builtin.meta: flush_handlers