From dcd5159c172f50b9708cb146e4f3a11060dee243 Mon Sep 17 00:00:00 2001 From: Mark Goddard <mark@stackhpc.com> Date: Mon, 20 Apr 2020 15:59:24 +0100 Subject: [PATCH] Remove nameservers with any IP in overcloud resolv.conf workaround Kayobe has a workaround for CentOS cloud images which contain a bogus nameserver entry in /etc/resolv.conf. By setting overcloud_host_image_workaround_resolv_enabled to true, the entry would be removed. Previously we removed a specific IP address - 10.0.2.3 - that was present in the CentOS 7 images. However, it seems that CentOS 8 images have a different IP - 192.168.122.1. This change fixes the issue and becomes resilient to future changes by matching any IP address. This should be fairly safe, since this workaround is opt-in. Change-Id: I9323a38cb2bb627ff56f5713900be00595ea8d4b Story: 2006574 Task: 39484 --- ansible/group_vars/all/overcloud | 13 ++++++------- .../overcloud-host-image-workaround-resolv.yml | 15 +++++++-------- etc/kayobe/overcloud.yml | 13 ++++++------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/ansible/group_vars/all/overcloud b/ansible/group_vars/all/overcloud index 7383833b..b5930a21 100644 --- a/ansible/group_vars/all/overcloud +++ b/ansible/group_vars/all/overcloud @@ -22,13 +22,12 @@ disable_cloud_init: False ############################################################################### # Overcloud host image configuration. -# The CentOS cloud images from 7.2 (1511) onwards have a bogus name server -# entry in /etc/resolv.conf, 10.0.2.3. Cloud-init only appends name server -# entries to this file, and will not remove this bogus entry. Typically this -# leads to a delay of around 30 seconds when connecting via SSH, due to a -# timeout in NSS. The workaround employed here is to remove this bogus entry -# from the image using virt-customize, if it exists. See -# https://bugs.centos.org/view.php?id=14369. +# The CentOS cloud images have a bogus name server entry in /etc/resolv.conf, +# 192.168.122.1. Cloud-init only appends name server entries to this file, and +# will not remove this bogus entry. Typically this leads to a delay of around +# 30 seconds when connecting via SSH, due to a timeout in NSS. The workaround +# employed here is to remove this bogus entry from the image using +# virt-customize, if it exists. See https://bugs.centos.org/view.php?id=14369. overcloud_host_image_workaround_resolv_enabled: True # Workaround a CentOS 7.5 bug: cloud-init 0.7.9-24 does not correctly set diff --git a/ansible/overcloud-host-image-workaround-resolv.yml b/ansible/overcloud-host-image-workaround-resolv.yml index 16018ae5..baff4fc8 100644 --- a/ansible/overcloud-host-image-workaround-resolv.yml +++ b/ansible/overcloud-host-image-workaround-resolv.yml @@ -1,11 +1,10 @@ --- -# The CentOS cloud images from 7.2 (1511) onwards have a bogus name server -# entry in /etc/resolv.conf, 10.0.2.3. Cloud-init only appends name server -# entries to this file, and will not remove this bogus entry. Typically this -# leads to a delay of around 30 seconds when connecting via SSH, due to a -# timeout in NSS. The workaround employed here is to remove this bogus entry -# from the image using virt-customize, if it exists. See -# https://bugs.centos.org/view.php?id=14369. +# The CentOS cloud images have a bogus name server entry in /etc/resolv.conf, +# 192.168.122.1. Cloud-init only appends name server entries to this file, and +# will not remove this bogus entry. Typically this leads to a delay of around +# 30 seconds when connecting via SSH, due to a timeout in NSS. The workaround +# employed here is to remove this bogus entry from the image using +# virt-customize, if it exists. See https://bugs.centos.org/view.php?id=14369. - name: Ensure the overcloud host image has bogus name server entries removed hosts: seed @@ -32,5 +31,5 @@ --connection local --become -m command - -a "virt-customize -a /httpboot/deployment_image.qcow2 --edit \"/etc/resolv.conf:s/^nameserver 10\.0\.2\.3\$//\""' + -a "virt-customize -a /httpboot/deployment_image.qcow2 --edit \"/etc/resolv.conf:s/^nameserver .*\..*\..*\..*\$//\""' when: overcloud_host_image_workaround_resolv_enabled | bool diff --git a/etc/kayobe/overcloud.yml b/etc/kayobe/overcloud.yml index 0764600b..dbb68c5e 100644 --- a/etc/kayobe/overcloud.yml +++ b/etc/kayobe/overcloud.yml @@ -19,13 +19,12 @@ ############################################################################### # Overcloud host image configuration. -# The CentOS cloud images from 7.2 (1511) onwards have a bogus name server -# entry in /etc/resolv.conf, 10.0.2.3. Cloud-init only appends name server -# entries to this file, and will not remove this bogus entry. Typically this -# leads to a delay of around 30 seconds when connecting via SSH, due to a -# timeout in NSS. The workaround employed here is to remove this bogus entry -# from the image using virt-customize, if it exists. See -# https://bugs.centos.org/view.php?id=14369. +# The CentOS cloud images have a bogus name server entry in /etc/resolv.conf, +# 192.168.122.1. Cloud-init only appends name server entries to this file, and +# will not remove this bogus entry. Typically this leads to a delay of around +# 30 seconds when connecting via SSH, due to a timeout in NSS. The workaround +# employed here is to remove this bogus entry from the image using +# virt-customize, if it exists. See https://bugs.centos.org/view.php?id=14369. #overcloud_host_image_workaround_resolv_enabled: # Workaround a CentOS 7.5 bug: cloud-init 0.7.9-24 does not correctly set -- GitLab