ansible-edda/plays/system/roles/base/tasks/include/nftables.yml

29 lines
732 B
YAML
Raw Normal View History

- name: "nftables : install nftables"
ansible.builtin.apt:
name: "nftables"
- name: "nftables : configure nftables"
ansible.builtin.template:
src: "./nftables/nftables.conf.j2"
dest: "/etc/nftables.conf"
mode: 0755
2022-12-08 23:19:54 +01:00
register: system_base_nftables_conf
2022-12-06 00:10:53 +01:00
- name: "nftables : enable nftables"
ansible.builtin.systemd:
name: "nftables"
enabled: true
- name: "nftables : start nftables"
ansible.builtin.systemd:
name: "nftables"
state: "started"
2022-12-08 23:19:54 +01:00
register: system_base_nftables_start
- name: "nftables : reload nftables configuration"
ansible.builtin.command:
cmd: "nft -f /etc/nftables.conf"
when:
2022-12-08 23:19:54 +01:00
system_base_nftables_conf.changed and
not system_base_nftables_start.changed