feat: Simplify configuration
This commit is contained in:
parent
c54305446d
commit
89a1ba95cd
@ -8,27 +8,23 @@
|
|||||||
mode: u=rw,g=r,o=r
|
mode: u=rw,g=r,o=r
|
||||||
src: "{{ role_path }}/templates/host.conf.j2"
|
src: "{{ role_path }}/templates/host.conf.j2"
|
||||||
dest: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
dest: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
||||||
when:
|
when: dnsmasq_hosts | length > 0
|
||||||
- dnsmasq_hosts | length > 0
|
become: true
|
||||||
- dnsmasq_host_ipv4 not in dnsmasq_hosts
|
delegate_to: "{{ dnsserver }}"
|
||||||
loop: "{{ dnsmasq_hosts }}"
|
loop: "{{ dnsmasq_hosts }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: dnsserver
|
loop_var: dnsserver
|
||||||
delegate_to: "{{ dnsserver }}"
|
|
||||||
become: true
|
|
||||||
notify: Recharger dnsmasq.service sur les serveurs
|
notify: Recharger dnsmasq.service sur les serveurs
|
||||||
|
|
||||||
- name: Supprimer le fichier lié à l'hôte
|
- name: Supprimer le fichier lié à l'hôte
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
path: /srv/dnsmasq/{{ dnsmasq_client_filename }}.conf
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when: dnsmasq_hosts | length > 0
|
||||||
- dnsmasq_hosts | length > 0
|
|
||||||
- dnsmasq_host_ipv4 not in dnsmasq_hosts
|
|
||||||
tags: [destruction, never]
|
tags: [destruction, never]
|
||||||
|
become: true
|
||||||
|
delegate_to: "{{ dnsserver }}"
|
||||||
loop: "{{ dnsmasq_hosts }}"
|
loop: "{{ dnsmasq_hosts }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: dnsserver
|
loop_var: dnsserver
|
||||||
delegate_to: "{{ dnsserver }}"
|
|
||||||
become: true
|
|
||||||
notify: Recharger dnsmasq.service sur les serveurs
|
notify: Recharger dnsmasq.service sur les serveurs
|
||||||
|
Loading…
Reference in New Issue
Block a user