system/tasks/systemd-resolved.yml

43 lines
981 B
YAML
Raw Normal View History

2023-02-27 19:49:41 +00:00
---
2023-10-21 19:13:21 +00:00
- name: Install Systemd-resolved
ansible.builtin.package:
2023-02-27 19:49:41 +00:00
name: systemd-resolved
state: present
2023-04-26 19:58:09 +00:00
become: true
2023-10-21 13:20:07 +00:00
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
2023-10-21 19:13:21 +00:00
- name: Install systemd-resolvconf
2023-10-21 19:13:21 +00:00
ansible.builtin.package:
name: systemd-resolvconf
state: present
when: ansible_os_family == "Archlinux"
become: true
- name: Enable Systemd-resolved
2023-02-27 19:49:41 +00:00
ansible.builtin.service:
name: systemd-resolved
state: started
enabled: true
2023-04-26 19:58:09 +00:00
become: true
- name: Restart Systemd-resolved
ansible.builtin.service:
name: systemd-resolved
state: restarted
become: true
when: ansible_os_family == "Debian"
- name: Restart Systemd-resolved
ansible.builtin.service:
name: dhcpcd
state: restarted
become: true
when: ansible_os_family == "Debian"
2024-02-21 18:07:38 +00:00
- name: Link resolv.conf
ansible.builtin.file:
state: link
src: "/run/systemd/resolve/stub-resolv.conf"
path: "/etc/resolv.conf"
force: true