role_dnsmasq/tasks/clients.yml

21 lines
560 B
YAML

---
# tasks file for security
- name: Générer le fichier d'hôtes en partant de l'inventaire ansible
ansible.builtin.template:
src: ansible_inventory.conf.j2
dest: /srv/dnsmasq/ansible_inventory.conf.disabled
owner: dnsmasq
group: root
mode: u=rw,g=r,o=r
when:
- dnsmasq_servers | length > 0
- dnsmasq_host_ipv4 not in dnsmasq_servers
tags: creation
loop: "{{ dnsmasq_servers }}"
loop_control:
loop_var: dnsserver
delegate_to: "{{ dnsserver }}"
become: true
notify: Recharger dnsmasq.service sur les serveurs