ansible/roles/nftables_infra/tasks/main.yml
Jeltz 64772b76e4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Add nftables role
This is a fully static version of the config, and it is meant to be
temporary (until I figure out a way to properly configure nftables using
ansible…).
2022-01-08 23:41:51 +01:00

38 lines
765 B
YAML

---
- name: Install nftables
apt:
name: nftables
- name: Create configuration directory
file:
path: /etc/nftables.d
state: directory
owner: root
group: root
mode: u=rwx,g=rx,o=rx
- name: Configure nftables
template:
src: "{{ item }}.j2"
dest: "/etc/{{ item }}"
owner: root
group: root
mode: u=rw,g=r,o=r
loop:
- nftables.conf
- nftables.d/10-vars.conf
- nftables.d/20-blacklist.conf
- nftables.d/30-reverse-path-filter.conf
- nftables.d/40-input.conf
- nftables.d/50-output.conf
- nftables.d/60-forward.conf
- nftables.d/70-nat.conf
notify:
- Reload nftables
- name: Enable and start nftables
systemd:
name: nftables.service
enabled: true
state: started
...