-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,43 @@ | ||
--- | ||
# copyright Utrecht University | ||
|
||
- name: Update systemd-resolved config to use Google DNS servers | ||
- name: Update systemd-resolved config to use Google DNS servers (Ubuntu) | ||
ansible.builtin.template: | ||
src: resolved.conf.j2 | ||
dest: /etc/systemd/resolved.conf | ||
owner: root | ||
group: root | ||
mode: "0644" | ||
notify: Restart systemd-resolved | ||
when: ansible_os_family == 'Debian' | ||
|
||
|
||
- name: Update resolv.conf to use Google DNS servers (EL9) | ||
become: true | ||
when: ansible_os_family == 'RedHat' | ||
block: | ||
- name: Create manually configured DNS settings file | ||
ansible.builtin.copy: | ||
dest: /etc/resolv.conf.manually-configured | ||
content: | | ||
search yoda.test | ||
nameserver {{ common_custom_dns_primary }} | ||
nameserver {{ common_custom_dns_secondary }} | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
|
||
- name: Remove existing /etc/resolv.conf | ||
ansible.builtin.file: | ||
path: /etc/resolv.conf | ||
state: absent | ||
|
||
- name: Create symlink for /etc/resolv.conf | ||
ansible.builtin.file: | ||
src: /etc/resolv.conf.manually-configured | ||
dest: /etc/resolv.conf | ||
state: link | ||
force: true | ||
|
||
- name: Flush handlers for immediate effect of changing DNS configuration | ||
ansible.builtin.meta: flush_handlers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters