Browse Source

Fix "nftables" ansible role

Fixed "iptables" restore tasks:
- Using the "ipvX_rules_file.stat.exists" flag
- Retrieving the correct path name from the stored variable.

Change-Id: I61a07b9b0c0fd3c0906ed8efe0b09bf0988ccdfb
Closes-Bug: #1926313
changes/20/788320/2
Rodolfo Alonso Hernandez 6 months ago
parent
commit
97e34498f7
  1. 6
      roles/nftables/tasks/main.yaml

6
roles/nftables/tasks/main.yaml

@ -33,11 +33,13 @@
- name: Restore saved IPv4 iptables rules, stored by iptables-persistent
shell:
cmd: |
iptables-restore '{{ ipv4_rules_file }}'
iptables-restore '{{ ipv4_rules_file.stat.path }}'
become: yes
when: ipv4_rules_file.stat.exists
- name: Restore saved IPv6 iptables rules, stored by iptables-persistent
shell:
cmd: |
ip6tables-restore '{{ ipv6_rules_file }}'
ip6tables-restore '{{ ipv6_rules_file.stat.path }}'
become: yes
when: ipv6_rules_file.stat.exists

Loading…
Cancel
Save