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 2 months ago
parent
commit
97e34498f7
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      roles/nftables/tasks/main.yaml

+ 4
- 2
roles/nftables/tasks/main.yaml View File

@ -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