ansible/roles/configure_resolved/tasks/main.yml

24 lines
558 B
YAML
Raw Normal View History

2021-01-23 13:45:25 +01:00
---
- name: Change the DNS server
lineinfile:
path: /etc/systemd/resolved.conf
insertafter: '[Resolve]'
regexp: '^#?DNS='
line: "DNS={{ dns_resolve_server }}"
notify: Reload systemd-resolve
- name: Remove the stub listener
lineinfile:
path: /etc/systemd/resolved.conf
insertafter: '[Resolve]'
regexp: '^#?DNSStubListener='
line: "DNSStubListener=no"
notify: Reload systemd-resolve
- name: Link resolve conf
file:
src: /run/systemd/resolve/resolv.conf
dest: /etc/resolv.conf
state: link
force: yes