ansible/roles/dnsmasq/tasks/main.yaml
Louis Vallat a86eac38f0
fix: disable systemd-resolved before installing dnsmasq
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
2022-11-17 10:45:21 +01:00

29 lines
626 B
YAML

---
- name: Ensure systemd-resolved doesn't interfere
ansible.builtin.lineinfile:
path: /etc/systemd/resolved.conf
regexp: '^DNSStubListener='
insertafter: '^[Resolve]'
line: DNSStubListener=no
- name: Restart systemd-resolved service
ansible.builtin.service:
name: systemd-resolved
state: restarted
- name: Install dnsmasq
ansible.builtin.apt:
name: dnsmasq
state: latest
update_cache: true
- name: Enable dnsmasq service
ansible.builtin.service:
name: dnsmasq
state: started
- name: Start dnsmasq service
ansible.builtin.service:
name: dnsmasq
enabled: true