aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/firewall/tasks/file.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/firewall/tasks/file.yml')
-rw-r--r--roles/firewall/tasks/file.yml45
1 files changed, 0 insertions, 45 deletions
diff --git a/roles/firewall/tasks/file.yml b/roles/firewall/tasks/file.yml
deleted file mode 100644
index 5f4bb08..0000000
--- a/roles/firewall/tasks/file.yml
+++ /dev/null
@@ -1,45 +0,0 @@
-- name: Create temporary file
- ansible.builtin.tempfile:
- register: rules_file
-
-- name: Configure rules in temporary file
- become: true
- ansible.builtin.template:
- src: '{{ item.src }}'
- dest: '{{ rules_file.path }}'
- owner: root
- group: root
- mode: '640'
-
-- name: Print temporary file path
- ansible.builtin.debug:
- msg: 'Temporary rules file: {{ rules_file.path }}'
-
-# If I simply restart the netfilter-persistent service, it happily restarts,
-# effectively ignoring errors in files. That way the operator doesn't get
-# feedback if the rules file is malformed.
-- name: Check that rules are valid
- become: true
- ansible.builtin.command:
- argv:
- - '/usr/sbin/{{ item.tool }}-restore'
- - --test
- - '{{ rules_file.path }}'
- changed_when: false
-
-- name: Copy rules to /etc/iptables
- become: true
- ansible.builtin.copy:
- remote_src: true
- src: '{{ rules_file.path }}'
- dest: '{{ item.dest }}'
- owner: root
- group: root
- mode: '640'
- notify: firewall_reboot
-
-- name: Remove temporary file
- become: true
- ansible.builtin.file:
- path: '{{ rules_file.path }}'
- state: absent