18285584f1
In openSUSE Tumbleweed, the SuSEfirewall2 package was removed in favor of firewalld[1]. This commit updates the iptables persistance tasks to avoid using SuSEfirewall2 and instead use rc.local to restore saved rules upon restart, and undefines the iptables_service variable for SUSE since there is no service to restart any more. See the related change for image builds[2]. [1] https://lists.opensuse.org/opensuse-factory/2019-01/msg00490.html [2] https://review.opendev.org/683236 Change-Id: I0f8d74dd00df192c20b96a9368b964839c306171
21 lines
521 B
YAML
21 lines
521 B
YAML
- name: Persist ipv4 rules
|
|
become: yes
|
|
copy:
|
|
content: "{{ iptables_rules.stdout }}"
|
|
dest: "/etc/sysconfig/iptables"
|
|
|
|
- name: Persist ipv6 rules
|
|
become: yes
|
|
copy:
|
|
content: "{{ ip6tables_rules.stdout }}"
|
|
dest: "/etc/sysconfig/ip6tables"
|
|
|
|
- name: Configure rc.local to restore saved rules on restart
|
|
become: yes
|
|
blockinfile:
|
|
path: /etc/init.d/boot.local
|
|
insertbefore: "exit 0"
|
|
content: |
|
|
iptables-restore /etc/sysconfig/iptables
|
|
ip6tables-restore /etc/sysconfig/ip6tables
|