From 3b433647896b90b105a56e3542b2971526a024f8 Mon Sep 17 00:00:00 2001 From: "pulsar89.5" Date: Fri, 29 Dec 2023 11:18:06 +0100 Subject: [PATCH] fix: Include rules or tables --- tasks/configuration.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tasks/configuration.yml b/tasks/configuration.yml index 8fee599..7f2e6fa 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -1,16 +1,6 @@ --- # tasks file for nftables -- name: Déployer la configuration générale - ansible.builtin.template: - owner: root - group: root - mode: u=rw,g=,o= - src: nftables.conf.j2 - dest: /etc/nftables.conf - become: true - notify: Redémarrer nftables.service - - name: Construire la liste des règles ansible.builtin.set_fact: nftables_rules: "{{ nftables_rules + specific }}" @@ -27,13 +17,23 @@ vars: specific: "{{ lookup('ansible.builtin.vars', item, default='') }}" +- name: Déployer la configuration générale + ansible.builtin.template: + owner: root + group: root + mode: u=rw,g=,o= + src: nftables.conf.j2 + dest: /etc/nftables.conf + become: true + notify: Redémarrer nftables.service + - name: Déployer les règles ansible.builtin.template: owner: root group: root mode: u=rw,g=,o= - src: "{{ role_path }}/templates/rules.conf.j2" - dest: "/srv/nftables/rules.conf" + src: rules.conf.j2 + dest: /srv/nftables/rules.conf when: nftables_rules | length > 0 become: true notify: Redémarrer nftables.service