From 02d9abd43b2038b30308077de0e08d33906eaa24 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Fri, 12 Jun 2020 14:55:02 +0200 Subject: [PATCH] Disable automatic updates in dnf-based systems Fix errors caused by dnf automatic updates that are not really needed in ipa ramdisks. Change-Id: I541252fc5137aec755b9feb4f15b888a71c3c1be Story: 2007805 Task: 40067 --- .../post-install.d/80-ironic-python-agent-ramdisk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dib/ironic-python-agent-ramdisk/post-install.d/80-ironic-python-agent-ramdisk b/dib/ironic-python-agent-ramdisk/post-install.d/80-ironic-python-agent-ramdisk index 7e51d0a..2c5cb62 100755 --- a/dib/ironic-python-agent-ramdisk/post-install.d/80-ironic-python-agent-ramdisk +++ b/dib/ironic-python-agent-ramdisk/post-install.d/80-ironic-python-agent-ramdisk @@ -30,6 +30,18 @@ case "$DIB_INIT_SYSTEM" in if $DIB_IPA_ENABLE_RESCUE; then systemctl enable ironic-agent-create-rescue-user.path fi + # NOTE(rpittau) disable caching remote package index to prevent + # delays due to failures. + # This is a new service for dnf-based systems (e.g. Centos8) to speed + # up subsequent dnf commands, for example automated updates, and + # it's not really needed in the ipa-ramdisk as we shouldn't install + # anything during runtime. + if [[ ${IPA_DISTRO_FAMILY} == 'rh' ]]; then + if [[ ${YUM} == 'dnf' ]]; then + systemctl disable dnf-makecache.service + systemctl disable dnf-makecache.timer + fi + fi ;; sysv) update-rc.d iptables disable