role_dnsmasq/tasks/records.yml

19 lines
518 B
YAML

---
# tasks file for security
- name: Deploy records from ansible group
ansible.builtin.template:
src: "{{ role_path }}/templates/records_auto.conf.j2"
dest: "{{ dnsmasq_records_directory }}/auto-{{ dnsmasq_ansible_group }}.conf"
owner: dnsmasq
group: root
mode: u=rw,g=r,o=r
when: dnsmasq_hosts | length > 0
become: true
delegate_to: "{{ dnsserver }}"
loop: "{{ dnsmasq_hosts }}"
loop_control:
loop_var: dnsserver
run_once: true
notify: Restart dnsmasq.service on dns servers