diskimage-builder/diskimage_builder/elements/rhel-common/pre-install.d/01-module-configuration
Lon Hohberger 91ce15afd1 Fix runtime error if DIB_DNF_MODULE_STREAMS is not set
Initial patch for I78d7bcf214a45245e2073428120fcbdd968e1acd
works without the envvar set, however, 'set -eu' causes it to break
if unset.

This makes the module configuration variable not required to be
set, consistent with other DIB scripts.

Change-Id: I5ca80f518d0371a18c107c061dc923876463af57
Signed-off-by: Lon Hohberger <lhh@redhat.com>
2020-10-07 07:28:46 -04:00

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