feat: Create role

This commit is contained in:
2025-04-01 16:49:12 +02:00
parent 69eeff1e45
commit 0fb68716a0
9 changed files with 156 additions and 4 deletions

20
tasks/configuration.yml Normal file
View File

@@ -0,0 +1,20 @@
---
# tasks file for nftables
- name: Build rules list
ansible.builtin.set_fact:
nftables_rules: "{{ nftables_rules + specific }}"
when: specific | length > 0
loop: "{{ lookup('ansible.builtin.varnames', '^nftables_rules_.+', wantlist=True) }}"
vars:
specific: "{{ lookup('ansible.builtin.vars', item, default='') }}"
- name: Deploy configuration file
ansible.builtin.template:
src: "{{ nftables_conf_template }}"
dest: "{{ nftables_conf_path }}"
owner: root
group: root
mode: u=rw,g=,o=
become: true
notify: Restart nftables.service