system-config/playbooks/roles/iptables/handlers/main.yaml
James E. Blair 3706754b6b Don't import tasks in iptables reload and use listen
This syntax doesn't work in Ansible 2.8.0.  Futher, we can use
"listen" to collapse the notify to a single item (at the
expense of duplicating the when clause in the handlers).

Change-Id: I05e2d32f4e1e692ac528a7254c6e3be2858ebacf
2018-12-03 08:59:30 -08:00

20 lines
551 B
YAML

- name: Reload iptables (Debian)
command: '{{ reload_command }}'
when:
- not ansible_facts.is_chroot
- ansible_facts.os_family == 'Debian'
listen: "Reload iptables"
- name: Reload iptables (RedHat)
command: 'systemctl reload iptables'
when:
- not ansible_facts.is_chroot
- ansible_facts.os_family == 'RedHat'
listen: "Reload iptables"
- name: Reload ip6tables (Red Hat)
command: 'systemctl reload ip6tables'
when:
- not ansible_facts.is_chroot
- ansible_facts.os_family == 'RedHat'
listen: "Reload iptables"