feat: Add var to renew configuration
This commit is contained in:
parent
3b43364789
commit
d18eac4ff0
@ -4,6 +4,12 @@ Ce rôle permet d'installer et configurer nftables.
|
||||
|
||||
## Variables
|
||||
|
||||
### nftables_renew_configuration
|
||||
|
||||
Booléen permettant de supprimer la configuration avant de la déployer.
|
||||
|
||||
*<span style="text-decoration: underline">Valeur par défaut:</span> false*
|
||||
|
||||
### nftables_rules_*
|
||||
|
||||
Liste contenant un nom de fichier et une liste de règles. Les règles doivent être au format nftables.
|
||||
|
@ -1,5 +1,7 @@
|
||||
---
|
||||
# defaults file for nftables
|
||||
|
||||
nftables_renew_configuration: false
|
||||
|
||||
nftables_rules: []
|
||||
nftables_tables: []
|
||||
|
@ -7,14 +7,21 @@
|
||||
state: present
|
||||
name: nftables
|
||||
|
||||
- name: Supprimer le dossier contenant la configuration
|
||||
ansible.builtin.file:
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
state: absent
|
||||
path: /srv/nftables
|
||||
when: nftables_renew_configuration
|
||||
become: true
|
||||
|
||||
- name: Créer le dossier contenant la configuration
|
||||
ansible.builtin.file:
|
||||
owner: root
|
||||
group: root
|
||||
mode: u=rwx,g=rx,o=rx
|
||||
state: "{{ item }}"
|
||||
state: directory
|
||||
path: /srv/nftables
|
||||
become: true
|
||||
loop:
|
||||
- absent
|
||||
- directory
|
||||
|
Loading…
Reference in New Issue
Block a user