nftables(role): introduce role for deploying nftables
This commit is contained in:
parent
217b44c3fa
commit
c8fa55fafd
6 changed files with 44 additions and 0 deletions
|
@ -91,6 +91,8 @@ base_config_hosts:
|
||||||
systemd_networkd_hosts:
|
systemd_networkd_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
router:
|
router:
|
||||||
|
nftables_hosts:
|
||||||
|
hosts:
|
||||||
docker_compose_hosts:
|
docker_compose_hosts:
|
||||||
hosts:
|
hosts:
|
||||||
ccchoir:
|
ccchoir:
|
||||||
|
|
|
@ -9,6 +9,11 @@
|
||||||
roles:
|
roles:
|
||||||
- systemd_networkd
|
- systemd_networkd
|
||||||
|
|
||||||
|
- name: Ensure nftables deployment on nftables_hosts
|
||||||
|
hosts: nftables_hosts
|
||||||
|
roles:
|
||||||
|
- nftables
|
||||||
|
|
||||||
- name: Ensure deployment of infrastructure authorized keys
|
- name: Ensure deployment of infrastructure authorized keys
|
||||||
hosts: infrastructure_authorized_keys_hosts
|
hosts: infrastructure_authorized_keys_hosts
|
||||||
roles:
|
roles:
|
||||||
|
|
11
roles/nftables/README.md
Normal file
11
roles/nftables/README.md
Normal 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.
|
5
roles/nftables/handlers/main.yaml
Normal file
5
roles/nftables/handlers/main.yaml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
- name: Restart nftables service
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: nftables
|
||||||
|
state: restarted
|
||||||
|
become: true
|
6
roles/nftables/meta/argument_specs.yaml
Normal file
6
roles/nftables/meta/argument_specs.yaml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
argument_specs:
|
||||||
|
main:
|
||||||
|
options:
|
||||||
|
nftables__config:
|
||||||
|
type: str
|
||||||
|
required: true
|
15
roles/nftables/tasks/main.yaml
Normal file
15
roles/nftables/tasks/main.yaml
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue