- name: Save iptables rules when: "iptables_persistent_save_to_file is true" block: - name: Save rules with iptables-persistent v4 ansible.builtin.shell: iptables-save > /etc/iptables/rules.v4 - name: Save rules with iptables-persistent v6 ansible.builtin.shell: ip6tables-save > /etc/iptables/rules.v6