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
This commit is contained in:
Riccardo Pittau 2023-03-01 14:43:07 +01:00
parent 0e6be25ee1
commit fb6d6d6fe9
2 changed files with 18 additions and 4 deletions

View File

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

View File

@ -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;;