From 914d61d83bbebe0097f6337d4741d512baa9e186 Mon Sep 17 00:00:00 2001 From: Piotr Parczewski Date: Thu, 4 Feb 2021 16:49:09 +0100 Subject: [PATCH] Remove CentOS 7 image resolv.conf workaround This workaround is no longer needed for current CentOS 8 images as resolv.conf file comes now empty. Moreover, the workaround has been preventing seed host configure from running successfully on Ubuntu hosts. Change-Id: I30e34e3c58db3f3a93a07f3d6d53671286e4260e --- ansible/group_vars/all/overcloud | 11 ------ ...overcloud-host-image-workaround-resolv.yml | 35 ------------------- etc/kayobe/overcloud.yml | 11 ------ kayobe/cli/commands.py | 4 --- kayobe/tests/unit/cli/test_commands.py | 5 --- playbooks/kayobe-seed-base/overrides.yml.j2 | 4 --- .../kayobe-seed-upgrade-base/overrides.yml.j2 | 1 + ...solv-conf-workaround-4cb484d3a66c4e58.yaml | 6 ++++ 8 files changed, 7 insertions(+), 70 deletions(-) delete mode 100644 ansible/overcloud-host-image-workaround-resolv.yml create mode 100644 releasenotes/notes/remove-resolv-conf-workaround-4cb484d3a66c4e58.yaml diff --git a/ansible/group_vars/all/overcloud b/ansible/group_vars/all/overcloud index ae77909b3..35fb55f27 100644 --- a/ansible/group_vars/all/overcloud +++ b/ansible/group_vars/all/overcloud @@ -18,14 +18,3 @@ overcloud_group_hosts_map: {} # To prevent some network issues you can choose to disable cloud-init disable_cloud_init: False - -############################################################################### -# Overcloud host image configuration. - -# 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 diff --git a/ansible/overcloud-host-image-workaround-resolv.yml b/ansible/overcloud-host-image-workaround-resolv.yml deleted file mode 100644 index 7cb4ef765..000000000 --- a/ansible/overcloud-host-image-workaround-resolv.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# 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 - tags: - - overcloud-host-image-workaround - tasks: - - block: - - name: Ensure libguestfs-tools is installed - command: > - docker exec bifrost_deploy - bash -c ' - ansible localhost - --connection local - --become - -m dnf - -a "name=libgcrypt,libgcrypt-devel,libguestfs-tools state=present"' - - - name: Ensure the overcloud host image has bogus name server entries removed - command: > - docker exec bifrost_deploy - bash -c ' - export LIBGUESTFS_BACKEND=direct && - ansible localhost - --connection local - --become - -m command - -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 c6d692e92..d7333690a 100644 --- a/etc/kayobe/overcloud.yml +++ b/etc/kayobe/overcloud.yml @@ -16,17 +16,6 @@ # To prevent some network issues you can choose to disable cloud-init #disable_cloud_init: -############################################################################### -# Overcloud host image configuration. - -# 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: - ############################################################################### # Dummy variable to allow Ansible to accept this file. workaround_ansible_issue_8743: yes diff --git a/kayobe/cli/commands.py b/kayobe/cli/commands.py index c5ca16c10..94fb42eca 100644 --- a/kayobe/cli/commands.py +++ b/kayobe/cli/commands.py @@ -694,7 +694,6 @@ class SeedServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, * Configures the bifrost service. * Deploys the bifrost container using kolla-ansible. * Builds disk images for the overcloud hosts using Diskimage Builder (DIB). - * Performs a workaround in the overcloud host image to fix resolv.conf. * Configures ironic inspector introspection rules in the bifrost inspector service. * When enabled, configures a Bare Metal Provisioning (BMP) environment for @@ -711,7 +710,6 @@ class SeedServiceDeploy(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, self.run_kolla_ansible_seed(parsed_args, "deploy-bifrost") playbooks = _build_playbook_list( - "overcloud-host-image-workaround-resolv", "seed-introspection-rules", "dell-switch-bmp") self.run_kayobe_playbooks(parsed_args, playbooks) @@ -727,7 +725,6 @@ class SeedServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, * Prepares the bifrost service for an upgrade. * Deploys the bifrost container using kolla-ansible. * Builds disk images for the overcloud hosts using Diskimage Builder (DIB). - * Performs a workaround in the overcloud host image to fix resolv.conf. * Configures ironic inspector introspection rules in the bifrost inspector service. * When enabled, configures a Bare Metal Provisioning (BMP) environment for @@ -747,7 +744,6 @@ class SeedServiceUpgrade(KollaAnsibleMixin, KayobeAnsibleMixin, VaultMixin, self.run_kayobe_playbooks(parsed_args, playbooks) self.run_kolla_ansible_seed(parsed_args, "upgrade-bifrost") playbooks = _build_playbook_list( - "overcloud-host-image-workaround-resolv", "seed-introspection-rules", "dell-switch-bmp") self.run_kayobe_playbooks(parsed_args, playbooks) diff --git a/kayobe/tests/unit/cli/test_commands.py b/kayobe/tests/unit/cli/test_commands.py index aebb7edf3..4339eb567 100644 --- a/kayobe/tests/unit/cli/test_commands.py +++ b/kayobe/tests/unit/cli/test_commands.py @@ -798,8 +798,6 @@ class TestCase(unittest.TestCase): mock.call( mock.ANY, [ - utils.get_data_files_path( - "ansible", "overcloud-host-image-workaround-resolv.yml"), # noqa utils.get_data_files_path( "ansible", "seed-introspection-rules.yml"), utils.get_data_files_path( @@ -855,9 +853,6 @@ class TestCase(unittest.TestCase): mock.call( mock.ANY, [ - utils.get_data_files_path( - "ansible", - "overcloud-host-image-workaround-resolv.yml"), utils.get_data_files_path( "ansible", "seed-introspection-rules.yml"), diff --git a/playbooks/kayobe-seed-base/overrides.yml.j2 b/playbooks/kayobe-seed-base/overrides.yml.j2 index b875cd23a..c6d9ca056 100644 --- a/playbooks/kayobe-seed-base/overrides.yml.j2 +++ b/playbooks/kayobe-seed-base/overrides.yml.j2 @@ -14,10 +14,6 @@ kolla_ansible_source_version: "{{ zuul.projects['opendev.org/openstack/kolla-ans kolla_openstack_logging_debug: True pip_upper_constraints_file: "/tmp/upper-constraints.txt" -# NOTE(mgoddard): We're using a cirros image, which doesn't require the -# resolv.conf work around used for CentOS. -overcloud_host_image_workaround_resolv_enabled: false - # Use the CI infra's PyPI mirror. pip_local_mirror: true pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple" diff --git a/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 b/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 index c88b54808..8cd2d7376 100644 --- a/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 +++ b/playbooks/kayobe-seed-upgrade-base/overrides.yml.j2 @@ -18,6 +18,7 @@ kolla_openstack_logging_debug: True # NOTE(mgoddard): We're using a cirros image, which doesn't require the # resolv.conf work around used for CentOS. +# NOTE(piotrp): to be removed after Wallaby is released overcloud_host_image_workaround_resolv_enabled: false # Use the CI infra's PyPI mirror. diff --git a/releasenotes/notes/remove-resolv-conf-workaround-4cb484d3a66c4e58.yaml b/releasenotes/notes/remove-resolv-conf-workaround-4cb484d3a66c4e58.yaml new file mode 100644 index 000000000..db341c442 --- /dev/null +++ b/releasenotes/notes/remove-resolv-conf-workaround-4cb484d3a66c4e58.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Removes the workaround for bogus name server entries in some CentOS 7 + images, together with the ``overcloud_host_image_workaround_resolv_enabled`` + variable.