zuul-jobs/roles/persistent-firewall/tasks/persist/Ubuntu_trusty.yaml
David Moreau-Simard 0bb84bc58e
Persist iptables rules
We configured iptables rules but did not persist them.
This meant that rules would be flushed when restarting iptables or
the instance.

Change-Id: I9d90f55323a33d6a0f0dda1f7ab25d10984fa6cb
2017-10-31 17:39:32 -04:00

25 lines
507 B
YAML

- name: Install iptables-persistent
become: yes
package:
name: iptables-persistent
state: installed
- name: Persist ipv4 rules
become: yes
copy:
content: "{{ iptables_rules.stdout }}"
dest: "/etc/iptables/rules.v4"
- name: Persist ipv6 rules
become: yes
copy:
content: "{{ ip6tables_rules.stdout }}"
dest: "/etc/iptables/rules.v6"
- name: Ensure iptables-persistent is started
become: yes
service:
name: iptables-persistent
state: started
enabled: yes