summaryrefslogtreecommitdiff
path: root/roles/configure_iptables/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/configure_iptables/tasks/main.yml')
-rw-r--r--roles/configure_iptables/tasks/main.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/roles/configure_iptables/tasks/main.yml b/roles/configure_iptables/tasks/main.yml
new file mode 100644
index 0000000..34f6c27
--- /dev/null
+++ b/roles/configure_iptables/tasks/main.yml
@@ -0,0 +1,26 @@
+---
+- name: copy iptables.rules
+ copy:
+ src: iptables.rules
+ dest: /etc/iptables/iptables.rules
+ register: iptables_rules
+
+- name: start and enable iptables service
+ when: iptables_rules.changed
+ systemd:
+ name: iptables.service
+ enabled: yes
+ state: reloaded
+
+- name: copy ip6tables.rules
+ copy:
+ src: ip6tables.rules
+ dest: /etc/iptables/ip6tables.rules
+ register: ip6tables_rules
+
+- name: start and enable ip6tables service
+ when: ip6tables_rules.changed
+ systemd:
+ name: ip6tables.service
+ enabled: yes
+ state: reloaded