23 lines
552 B
YAML
23 lines
552 B
YAML
|
- name: Create directory for systemd-resolved
|
||
|
file:
|
||
|
path: /etc/systemd/resolved.conf.d
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0755
|
||
|
|
||
|
- name: Add custom DNS server config
|
||
|
copy:
|
||
|
src: etc/systemd/resolved.conf.d/custom_dns.conf
|
||
|
dest: /etc/systemd/resolved.conf.d/custom_dns.conf
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0644
|
||
|
register: config_change
|
||
|
|
||
|
- name: Reload DNS daemon after file change
|
||
|
systemd:
|
||
|
name: systemd-resolved.service
|
||
|
daemon_reload: yes
|
||
|
state: restarted
|
||
|
when: config_change.changed
|