You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/configure_resolved/tasks/main.yml

24 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