[EVO] Gérer des fichiers spécifiques
This commit is contained in:
parent
201ae6d94a
commit
ec27f453db
@ -46,6 +46,12 @@ Nom d'hôte du client.
|
||||
|
||||
*<span style="text-decoration: underline">Valeur par défaut:</span> `{{ inventory_hostname }} {{ inventory_hostname_short }}`*
|
||||
|
||||
### dnsmasq_specifics
|
||||
|
||||
Liste de dictionnaire contenant le nom de fichier et les éléments spécifiques au format `/etc/hosts`.
|
||||
|
||||
*<span style="text-decoration: underline">Valeur par défaut:</span> aucune*
|
||||
|
||||
## Exemple d'utilisation
|
||||
|
||||
### inventory.yml
|
||||
|
@ -11,3 +11,5 @@ dnsmasq_host_aliases: []
|
||||
|
||||
dnsmasq_client_filename: "{{ inventory_hostname }}"
|
||||
dnsmasq_client_hostname: "{{ inventory_hostname }} {{ inventory_hostname_short }}"
|
||||
|
||||
dnsmasq_specifics: []
|
||||
|
@ -13,10 +13,24 @@
|
||||
|
||||
- name: Déployer la configuration de l'instance
|
||||
ansible.builtin.template:
|
||||
src: host.conf.j2
|
||||
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
||||
owner: dnsmasq
|
||||
group: root
|
||||
mode: u=rw,g=r,o=r
|
||||
src: host.conf.j2
|
||||
dest: /srv/dnsmasq/{{ inventory_hostname }}.conf
|
||||
become: true
|
||||
notify: Recharger dnsmasq.service
|
||||
|
||||
- name: Déployer les configurations specifiques
|
||||
ansible.builtin.template:
|
||||
src: specifics.j2
|
||||
dest: /srv/dnsmasq/{{ item.filename }}.conf
|
||||
owner: dnsmasq
|
||||
group: root
|
||||
mode: u=rw,g=r,o=r
|
||||
when: dnsmasq_specifics | length > 0
|
||||
become: true
|
||||
notify: Recharger dnsmasq.service
|
||||
loop: "{{ dnsmasq_specifics }}"
|
||||
loop_control:
|
||||
label: "{{ item.filename }}"
|
||||
|
Loading…
Reference in New Issue
Block a user