From fc017249c23cb819fd44202e2cff80d563cab8ee Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Sat, 2 May 2020 12:10:09 +0200 Subject: [PATCH] Install coreutils package before using configdrive role On seed hypervisors running CentOS 8, the configdrive role will fail to install coreutils if coreutils-single is already present: Error: Problem: problem with installed package coreutils-single-8.30-6.el8.x86_64 - package coreutils-8.30-6.el8_1.1.x86_64 conflicts with coreutils-single provided by coreutils-single-8.30-6.el8.x86_64 - package coreutils-8.30-6.el8_1.1.x86_64 conflicts with coreutils-single provided by coreutils-single-8.30-6.el8_1.1.x86_64 - conflicting requests Until the role handles it, install coreutils using the --allowerasing option which will remove coreutils-single at the same time. Use a command task for now since this option has just been added to ansible:devel [1]. [1] https://github.com/ansible/ansible/pull/48319 Change-Id: I43bbe9dae3d6796e308fbf66cb04d16b57ff5e37 Story: 2007612 Task: 39607 --- ansible/seed-vm-provision.yml | 11 +++++++++++ ...ix-coreutils-single-conflict-208036c66b9f7e59.yaml | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/fix-coreutils-single-conflict-208036c66b9f7e59.yaml diff --git a/ansible/seed-vm-provision.yml b/ansible/seed-vm-provision.yml index cbe19308b..4263feb59 100644 --- a/ansible/seed-vm-provision.yml +++ b/ansible/seed-vm-provision.yml @@ -11,6 +11,17 @@ currently {{ groups['seed'] | length }}. when: groups['seed'] | length != 1 + # NOTE(priteau): On seed hypervisors running CentOS 8, the configdrive role + # will fail to install coreutils if coreutils-single is already present. + # Until the role handles it, install it using the --allowerasing option + # which will remove coreutils-single. + - name: Ensure coreutils package is installed + command: "dnf install coreutils -y --allowerasing" + become: True + when: + - ansible_os_family == 'RedHat' + - ansible_distribution_major_version | int >= 8 + - name: Ensure the image cache directory exists file: path: "{{ image_cache_path }}" diff --git a/releasenotes/notes/fix-coreutils-single-conflict-208036c66b9f7e59.yaml b/releasenotes/notes/fix-coreutils-single-conflict-208036c66b9f7e59.yaml new file mode 100644 index 000000000..8ecc880df --- /dev/null +++ b/releasenotes/notes/fix-coreutils-single-conflict-208036c66b9f7e59.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes a package conflict while provisioning a seed VM on a CentOS 8 seed + hypervisor with ``coreutils-single`` already installed. See `story 2007612 + `__ for details.