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