feat: Merge rules and tables in one file

This commit is contained in:
pulsar89.5 2023-12-28 17:39:20 +01:00
parent 35d31eb752
commit 206dbdd22f
2 changed files with 9 additions and 7 deletions

View File

@ -33,10 +33,10 @@
group: root
mode: u=rw,g=,o=
src: "{{ role_path }}/templates/rules.conf.j2"
dest: "/srv/nftables/rules_{{ item.filename }}.conf"
loop: "{{ nftables_rules }}"
loop_control:
label: "{{ item.filename }}"
dest: "/srv/nftables/rules.conf"
# loop: "{{ nftables_rules }}"
# loop_control:
# label: "{{ item.filename }}"
become: true
notify: Redémarrer nftables.service

View File

@ -1,5 +1,7 @@
# {{ ansible_managed }}
{% for rule in item.rules %}
{{ rule }}
{% endfor %}
{% for item in nftables_rules %}
# BEGIN {{ item.name }}
{{ item.rules | join('\n') }}
# END {{ item.name }}
{%+ endfor %}