29 lines
686 B
YAML
29 lines
686 B
YAML
---
|
|
- name: Enable and start systemd-resolved
|
|
ansible.builtin.service:
|
|
name: systemd-resolved
|
|
enabled: yes
|
|
state: started
|
|
|
|
- name: Make NetworkManager use the systemd-resolved
|
|
ansible.builtin.copy:
|
|
content: |
|
|
[main]
|
|
dns=systemd-resolved
|
|
|
|
dest: /etc/NetworkManager/conf.d/systemd-resolved.conf
|
|
owner: root
|
|
group: root
|
|
mode: "0600"
|
|
|
|
- name: Replace the original resolv.conf with systemd-resolved reference
|
|
ansible.builtin.file:
|
|
src: /run/systemd/resolve/resolv.conf
|
|
path: /etc/resolv.conf
|
|
state: link
|
|
force: true
|
|
|
|
- name: Restart the NetworkManager
|
|
ansible.builtin.service:
|
|
name: NetworkManager
|
|
state: restarted
|