2022-11-18 18:33:37 +01:00
|
|
|
- name: Handle iptables-persistent
|
|
|
|
when:
|
|
|
|
- "is_docker is not true"
|
2022-11-23 11:59:37 +01:00
|
|
|
- "iptables_persistent_save_to_file is true"
|
2022-11-18 18:33:37 +01:00
|
|
|
block:
|
|
|
|
- name: Install iptables-persistent package
|
|
|
|
ansible.builtin.package:
|
|
|
|
name: "{{ iptables_persistent_package_name_by_os_family[ansible_os_family] }}"
|
|
|
|
|
|
|
|
- name: Gather package facts
|
|
|
|
package_facts:
|
|
|
|
manager: auto
|
|
|
|
|
|
|
|
- name: Save iptables rules into /etc/iptables folder
|
|
|
|
when:
|
|
|
|
- "'iptables-persistent' in ansible_facts.packages"
|
|
|
|
block:
|
|
|
|
- include_tasks: "save_rules_for_{{ ansible_os_family }}.yml"
|