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
This commit is contained in:
Pierre Riteau 2020-05-02 12:10:09 +02:00
parent 93c471406a
commit fc017249c2
2 changed files with 17 additions and 0 deletions

View File

@ -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 }}"

View File

@ -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
<https://storyboard.openstack.org/#!/story/2007612>`__ for details.