Infra/ansible/roles/pi_dnsmasq/tasks/main.yml
2020-10-28 23:00:41 +01:00

28 lines
572 B
YAML

- name: Set up dnsmasq hosts
register: dnsmasq_hosts
become: true
ansible.builtin.template:
src: hosts.custom.j2
group: root
owner: root
mode: 0644
dest: /etc/hosts.custom
- name: Set up dnsmasq rules
register: dnsmasq
become: true
ansible.builtin.template:
src: 02-custom.conf.j2
group: root
owner: root
mode: 0644
dest: /etc/dnsmasq.d/02-custom.conf
- name: Restart PiHole systems
when: dnsmasq.changed or dnsmasq_hosts.changed
become: true
ansible.builtin.command:
argv:
- pihole
- restartdns