dotfiles/roles/wg/tasks/dns_AlmaLinux.yml
Matej Focko bc2d4a291e
chore(wg): factor out the wireguard role
Signed-off-by: Matej Focko <me@mfocko.xyz>
2024-07-12 19:53:09 +02:00

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