roles/common: Use nftables firewalld backend on Debian 10

nftables is the iptables replacement. There is support for nftables
in firewalld since v0.6.0.

See: https://firewalld.org/2018/07/nftables-backend
This commit is contained in:
Alan Orth 2019-10-18 19:02:17 +03:00
parent 7c0b458bc1
commit cac38af09b
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

View File

@ -8,6 +8,15 @@
- firewalld - firewalld
- tidy - tidy
- name: Use nftables backend in firewalld
when: ansible_distribution_major_version is version_compare('10', '>=')
lineinfile:
dest: /etc/firewalld/firewalld.conf
regexp: '^FirewallBackend=iptables$'
line: 'FirewallBackend=nftables'
notify:
- restart firewalld
- name: Copy firewalld public zone file - name: Copy firewalld public zone file
when: ansible_distribution_major_version is version_compare('8', '>=') when: ansible_distribution_major_version is version_compare('8', '>=')
template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600 template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600