2022-09-11 20:55:30 +02:00
|
|
|
- name: Install nftables
|
|
|
|
apt:
|
|
|
|
name: nftables
|
|
|
|
|
|
|
|
- name: Configure nftables
|
|
|
|
template:
|
2022-09-24 00:15:46 +02:00
|
|
|
src: ./filesystem/{{ ansible_host }}/etc/nftables.conf.j2
|
2022-09-11 20:55:30 +02:00
|
|
|
dest: /etc/nftables.conf
|
|
|
|
mode: 0755
|
|
|
|
register: nftables_conf
|
|
|
|
|
|
|
|
- name: Enable/start nftables
|
|
|
|
systemd:
|
|
|
|
name: nftables
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
|
|
|
|
- name: Restart nftables
|
|
|
|
systemd:
|
|
|
|
name: nftables
|
|
|
|
state: restarted
|
2022-09-25 13:15:17 +02:00
|
|
|
register: nftables_restart
|
2022-09-11 20:55:30 +02:00
|
|
|
when:
|
|
|
|
nftables_conf is changed
|
2022-09-25 13:15:17 +02:00
|
|
|
|
|
|
|
- name: Restart networking
|
|
|
|
systemd:
|
|
|
|
name: networking
|
|
|
|
state: restarted
|
|
|
|
when:
|
|
|
|
nftables_restart is changed
|