ansible-edda/plays/roles/system_base/tasks/include/nftables.yml
2022-12-06 00:10:53 +01:00

29 lines
684 B
YAML

- 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
register: nftables_conf
- name: "nftables : enable nftables"
ansible.builtin.systemd:
name: "nftables"
enabled: true
- name: "nftables : start nftables"
ansible.builtin.systemd:
name: "nftables"
state: "started"
register: nftables_start
- name: "nftables : reload nftables configuration"
ansible.builtin.command:
cmd: "nft -f /etc/nftables.conf"
when:
nftables_conf.changed and
not nftables_start.changed