forked from infra/ansible
base: disable iptables service when nftables is enabled
When `nftables=True` the base role deploys nftables rules and enables the nftables service, but never disables the iptables service. On freshly provisioned hosts the iptables service can be left running from cloud-init, overwriting nftables rules and silently dropping traffic on ports defined in `tcp_ports`. Stop and disable the iptables service explicitly when nftables is the intended firewall backend.
This commit is contained in:
parent
ff663e686f
commit
99f1ff2202
1 changed files with 10 additions and 0 deletions
|
|
@ -276,6 +276,16 @@
|
|||
- baseiptables|bool
|
||||
- not nftables
|
||||
|
||||
- name: Iptables service disabled
|
||||
service: name=iptables state=stopped enabled=false
|
||||
tags:
|
||||
- iptables
|
||||
- service
|
||||
- base
|
||||
when:
|
||||
- baseiptables|bool
|
||||
- nftables
|
||||
|
||||
- name: Nftables service enabled
|
||||
service: name=nftables state=started enabled=true
|
||||
tags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue