epel: allow epel-release to not be installed at all

When DIB_EPEL_DISABLED=2 then the epel element will have no effect at
all, including not installing yum-utils or epel-release packages.

wget is not actually used by the epel element so it has been removed as
a package dependency.

This is to handle scenarios when EPEL is strictly disallowed, so package
install failures are preferred.

Change-Id: Ic6f6c92b28b80c4f0b93e4663129e73134f5b447
Signed-off-by: Steve Baker <sbaker@redhat.com>
This commit is contained in:
Steve Baker committed 2026-09-30 11:35:24 +13:00
1 parent d2e9aad18d
commit 4f9b204374
5 files changed
+18 -11

No files matched your search

+2 -1
View File
@@ -20,4 +20,5 @@ DIB_EPEL_DISABLED:
:Required: No
:Default: 0
:Description: To disable the EPEL repo (but leave it available if
used with an explicit ``--enablerepo``) set this to 1
used with an explicit ``--enablerepo``) set this to 1.
To avoid installing the epel-release entirely, set this to 2.
@@ -1,4 +0,0 @@
wget:
phase: pre-install.d
yum-utils:
phase: pre-install.d
-4
View File
@@ -1,20 +1,16 @@
{
"distro": {
"almalinux": {
"wget": "wget",
"yum-utils": "yum-utils"
},
"centos": {
"wget": "wget",
"yum-utils": "yum-utils"
},
"rocky": {
"wget": "wget",
"yum-utils": "yum-utils"
}
},
"default": {
"wget": "",
"yum-utils": ""
}
}
@@ -6,16 +6,22 @@ fi
set -eu
set -o pipefail
if [ ${DIB_EPEL_DISABLED:-0} -gt 1 ]; then
exit 0
fi
install-packages yum-utils
if [[ (${DISTRO_NAME} =~ "almalinux" || ${DISTRO_NAME} =~ "centos" || ${DISTRO_NAME} =~ "rocky") ]]; then
# Centos has "epel-release" in extras, which is default enabled.
${YUM} install -y epel-release
install-packages epel-release
else
echo "$DISTRO_NAME is not supported"
# Not really a failure; we just don't do anything
exit 0
fi
if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then
if [ ${DIB_EPEL_DISABLED:-0} -gt 0 ]; then
if [[ ${YUM} == "dnf" ]]; then
rpm -q dnf-plugins-core || dnf install -y dnf-plugins-core
dnf config-manager --set-disabled "epel*"
@@ -0,0 +1,8 @@
---
features:
- |
Previously `DIB_EPEL_DISABLED` was documented to install epel-release
but disable the repositories when set to `1`. It is now possible to
avoid installing the epel-release package entirely by setting
`DIB_EPEL_DISABLED` to `2`. This is to accomodate scenarios where
using EPEL is strictly forbidden.