Files
ilnmors-homelab/ansible/roles/common/tasks/node/set_nftables.yaml
T

28 lines
650 B
YAML

---
- name: Install nftables
ansible.builtin.apt:
name:
- "nftables"
state: "present"
become: true
- name: Enable nftables.service
ansible.builtin.systemd:
name: "nftables.service"
state: "started"
enabled: true
become: true
- name: Deploy nftables.conf
ansible.builtin.template:
src: "{{ hostvars['console']['node']['config_path'] }}/node/{{ node['name'] }}/nftables.conf.j2"
dest: "/etc/nftables.conf"
owner: "root"
group: "root"
mode: "0700"
validate: "/usr/sbin/nft -c -f %s"
become: true
notify:
- "notification_update_nftables"
- "notification_restart_crowdsec_bouncer"