Remove any existing nameserver entries before adding IPA server

If the undercloud nodes is created with entries already
in the /etc/resolv.conf file, the entries added to point to
the IPA server will be added after the existing entries.
This will cause the iIPA enrollment of the client to fail.

This review removes the existing entries before adding the
search domain to avoid the enrollment errors.

Change-Id: I67ebe6c429e89f6f303bf23ca5959e00d6a46df8
This commit is contained in:
Ronelle Landy 2020-06-11 17:29:33 -04:00
parent 4542945a5f
commit 213821b9af
2 changed files with 8 additions and 1 deletions

View File

@ -60,6 +60,13 @@
- ansible_os_family == 'RedHat'
- ansible_lsb.major_release is version(8, '>=')
- name: remove any existing entries from the resolv.conf file
become: true
lineinfile:
path: /etc/resolv.conf
regexp: "^nameserver "
state: absent
- name: set search domain
become: true
lineinfile:

View File

@ -20,7 +20,7 @@
- ^playbooks/.*minion.*$
- tripleo-ci-centos-8-standalone-on-multinode-ipa:
files:
- ^roles/.*multinode-ipa.*$
- ^roles/ipa-multinode.*$
- ^roles/standalone.*$
- ^playbooks/multinode-standalone-ipa.yml.*$
gate: