nftables(role): introduce role for deploying nftables

This commit is contained in:
June 2025-09-20 21:38:39 +02:00
commit c8fa55fafd
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
6 changed files with 44 additions and 0 deletions

11
roles/nftables/README.md Normal file
View file

@ -0,0 +1,11 @@
# Role `nftables`
Deploys nftables.
## Support Distributions
Should work on Debian-based distributions.
## Required Arguments
- `nftables__config`: nftables configuration to deploy.

View file

@ -0,0 +1,5 @@
- name: Restart nftables service
ansible.builtin.systemd_service:
name: nftables
state: restarted
become: true

View file

@ -0,0 +1,6 @@
argument_specs:
main:
options:
nftables__config:
type: str
required: true

View file

@ -0,0 +1,15 @@
- name: ensure nftables is installed
ansible.builtin.apt:
name: nftables
state: present
become: true
- name: deploy nftables configuration
ansible.builtin.copy:
content: "{{ nftables__config }}"
dest: "/etc/nftables.conf"
mode: "0644"
owner: root
group: root
become: true
notify: Restart nftables service