-
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.
add optional anasible task to enable custmized DNS (EL9)
- 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: Configure /etc/resolv.conf via Ansible (EL9) | ||
Check failure on line 15 in roles/common/tasks/custom_dns.yml
|
||
become: true | ||
Check failure on line 16 in roles/common/tasks/custom_dns.yml
|
||
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: yes | ||
Check failure on line 39 in roles/common/tasks/custom_dns.yml
|
||
when: ansible_os_family == 'RedHat' | ||
|
||
- 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