From fb6d6d6fe9fce956ea1da3bbf924222f56692917 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Wed, 1 Mar 2023 14:43:07 +0100 Subject: [PATCH] Fix enabling epel repo for rpm distributions The epel packages are installed but their content is purged in the centos nodes. Removing and reinstalling them when we run tests in CI to reenable their content. Change-Id: Ibf1d810a37811151449f79a24bb837db6663cce5 --- .../bifrost-ironic-install/tasks/install.yml | 19 +++++++++++++++---- scripts/install-deps.sh | 3 +++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/bifrost-ironic-install/tasks/install.yml b/playbooks/roles/bifrost-ironic-install/tasks/install.yml index b9f2a5f24..cbceb2de3 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/install.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/install.yml @@ -26,12 +26,23 @@ command: dnf config-manager --set-enabled crb when: ansible_distribution_version|int == 9 - - name: "Enable EPEL repository for EL7/8/9" + - name: "Enable EPEL repository for EL7/8" ansible.builtin.dnf: name: epel-release - when: - - enable_epel | bool - - ansible_distribution in ["AlmaLinux", "CentOS", "Rocky"] + state: latest + when: + - enable_epel | bool + - ansible_distribution in ["AlmaLinux", "CentOS", "Rocky"] + + - name: "Enable EPEL repositories for EL9" + ansible.builtin.dnf: + name: + - epel-next-release + state: latest + when: + - enable_epel | bool + - ansible_distribution == 'CentOS' + - ansible_distribution_version|int == 9 - name: "Enable EPEL repository for RedHat 9" command: dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index bdeaec29f..a8155d51a 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -66,6 +66,9 @@ case ${ID,,} in ) EXTRA_PKG_DEPS=() sudo -E ${PKG_MANAGER} updateinfo + # NOTE(rpittau): epel repos are installed but the content is purged + # in the CI images, we remove them and reinstall later + sudo -E ${PKG_MANAGER} remove -y epel-release epel-next-release ;; *) echo "ERROR: Supported package manager not found. Supported: apt, dnf, yum, zypper"; exit 1;;