2022-10-03 15:20:34 +00:00
|
|
|
---
|
|
|
|
# tasks file for security
|
|
|
|
|
|
|
|
- name: Déployer le fichier lié à l'hôte
|
|
|
|
ansible.builtin.template:
|
|
|
|
owner: dnsmasq
|
|
|
|
group: root
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
src: "{{ role_path }}/templates/host.conf.j2"
|
|
|
|
dest: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
2023-05-26 08:32:58 +00:00
|
|
|
when:
|
2024-05-06 18:20:59 +00:00
|
|
|
- dnsmasq_hosts | length > 0
|
|
|
|
- dnsmasq_host_ipv4 not in dnsmasq_hosts
|
|
|
|
loop: "{{ dnsmasq_hosts }}"
|
2022-10-03 15:20:34 +00:00
|
|
|
loop_control:
|
|
|
|
loop_var: dnsserver
|
|
|
|
delegate_to: "{{ dnsserver }}"
|
|
|
|
become: true
|
|
|
|
notify: Recharger dnsmasq.service sur les serveurs
|
|
|
|
|
|
|
|
- name: Supprimer le fichier lié à l'hôte
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
|
|
|
state: absent
|
2023-05-26 08:32:58 +00:00
|
|
|
when:
|
2024-05-06 18:20:59 +00:00
|
|
|
- dnsmasq_hosts | length > 0
|
|
|
|
- dnsmasq_host_ipv4 not in dnsmasq_hosts
|
2022-10-03 15:20:34 +00:00
|
|
|
tags: [destruction, never]
|
2024-05-06 18:20:59 +00:00
|
|
|
loop: "{{ dnsmasq_hosts }}"
|
2022-10-03 15:20:34 +00:00
|
|
|
loop_control:
|
|
|
|
loop_var: dnsserver
|
|
|
|
delegate_to: "{{ dnsserver }}"
|
|
|
|
become: true
|
|
|
|
notify: Recharger dnsmasq.service sur les serveurs
|