diskimage-builder/diskimage_builder/elements/yum/pre-install.d/01-module-configuration
Chandan Kumar (raukadah) ced54fea75 Make DIB_DNF_MODULE_STREAMS part of yum element
While building cloud images, it is common to set modules
for CentOS and RHEL images. Earlier it was part of rhel-common
which was specific to RHEL OS not for CentOS. Moving it
under yum element as module/stream can be enabled or disabled
via dnf itself.

Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Change-Id: Idc0f277f97e92e4d003f059f01b59f1b5513da34
2021-04-07 16:06:09 +05:30

25 lines
525 B
Bash
Executable File

#!/bin/bash
#
# When building RHEL overcloud images, certain modules may be preferred
# or even required.
#
# For example, container-tools:2.0 is notably a requirement when running
# the Train releases on RHEL 8.2.
#
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
export DIB_DNF_MODULE_STREAMS=${DIB_DNF_MODULE_STREAMS:-}
if [ "${YUM}" == "dnf" ]; then
for m in ${DIB_DNF_MODULE_STREAMS}; do
${YUM} -y module disable ${m/:*/}
${YUM} -y module enable ${m}
done
fi