23 lines
558 B
YAML
23 lines
558 B
YAML
---
|
|
- 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
|