Merge "Stop "dnf makecache" in the amphora images"

This commit is contained in:
Zuul 2020-03-16 21:46:02 +00:00 committed by Gerrit Code Review
commit 157ad64c66
4 changed files with 31 additions and 0 deletions

View File

@ -444,6 +444,11 @@ if [ "$AMP_ENABLE_FULL_MAC_SECURITY" -ne 1 ]; then
fi
fi
# Disable the dnf makecache timer
if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ]; then
AMP_element_sequence="$AMP_element_sequence disable-makecache"
fi
if [ "${AMP_BASEOS}" = "centos-minimal" ]; then
export DIB_YUM_MINIMAL_CREATE_INTERFACES=0
fi

View File

@ -0,0 +1,6 @@
This element disables the dnf makecache hourly timer.
The amphora typically do not have internet access nor access to DNS servers.
We want to disable this makecache timer to stop the amphora from attempting
to update/download the dnf cache every hour. Without this element it will
run and log a failure every hour.

View File

@ -0,0 +1,18 @@
#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
case $DISTRO_NAME in
fedora | centos* | rhel* )
systemctl disable dnf-makecache.timer || true
;;
*)
echo "ERROR: Unsupported distribution $DISTRO_NAME"
exit 1
;;
esac

View File

@ -0,0 +1,2 @@
disable-makecache:
default: disable-makecache