kayobe/ansible/overcloud-host-image-workaround-resolv.yml
Mark Goddard bd5c5c0187 Fix overcloud host image resolv workaround on CentOS 8.3
If a seed's bifrost_deploy container is deployed using a CentOS 8.2 base
image, prior to the CentOS 8.3 release, then a user runs 'kayobe seed
service deploy', the following task may fail:

    TASK [Ensure the overcloud host image has bogus name server entries removed]

This seems to be an issue with libgcrypt not being upgraded with
qemu-kvm, and becoming incompatible. The workaround is to ensure
libgcrypt is upgraded also.

Story: 2008430
Task: 41379

Change-Id: I82313fcd258e58969e0b68ae91a78943df537a7f
2020-12-18 08:41:55 +00:00

36 lines
1.4 KiB
YAML

---
# 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