diff --git a/roles/common/tasks/custom_dns.yml b/roles/common/tasks/custom_dns.yml index b900844e..56ab1fe3 100644 --- a/roles/common/tasks/custom_dns.yml +++ b/roles/common/tasks/custom_dns.yml @@ -12,8 +12,9 @@ when: ansible_os_family == 'Debian' -- name: Configure /etc/resolv.conf via Ansible (EL9) - become: true +- 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: @@ -36,8 +37,7 @@ src: /etc/resolv.conf.manually-configured dest: /etc/resolv.conf state: link - force: yes - when: ansible_os_family == 'RedHat' + force: true - name: Flush handlers for immediate effect of changing DNS configuration ansible.builtin.meta: flush_handlers diff --git a/roles/common/tasks/main-tasks.yml b/roles/common/tasks/main-tasks.yml index ce2bfde8..d19e3445 100644 --- a/roles/common/tasks/main-tasks.yml +++ b/roles/common/tasks/main-tasks.yml @@ -6,7 +6,7 @@ - name: Update local DNS settings ansible.builtin.import_tasks: custom_dns.yml - when: common_custom_dns_enable + when: common_custom_dns_enable - name: Setup EPEL repository ansible.builtin.import_tasks: epel.yml