ansible-debian/tasks/dns.yml

23 lines
552 B
YAML
Raw Normal View History

2024-04-15 16:01:15 +02:00
- 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