From: Frank Brehm Date: Mon, 29 Jun 2020 13:55:11 +0000 (+0200) Subject: Adding and using snippets/tpl.280.dist-upgrade.sh; version bump to 2.0.3 X-Git-Tag: 2.1.2^2~5^2~1 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=71ce570ebb47237e912480b1d5a7484a9e4069a1;p=pixelpark%2Fcreate-vmware-tpl.git Adding and using snippets/tpl.280.dist-upgrade.sh; version bump to 2.0.3 --- diff --git a/kickstart/template-oel7.ks b/kickstart/template-oel7.ks index f8e754d..b6444fe 100644 --- a/kickstart/template-oel7.ks +++ b/kickstart/template-oel7.ks @@ -231,6 +231,11 @@ echo echo "Using snippet $remove_uek_snippet" $SNIPPET($remove_uek_snippet) +#set $dist_upgrade_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.280.dist-upgrade.sh" +echo +echo "Using snippet $dist_upgrade_snippet" +$SNIPPET($dist_upgrade_snippet) + #set $create_motd_snippet = "per_status/" + $SYSTEM_STATUS + "/tpl.300.create-motd.sh" echo echo "Using snippet $create_motd_snippet" diff --git a/lib/cr_vmware_tpl/__init__.py b/lib/cr_vmware_tpl/__init__.py index 6273bfb..d8196e7 100644 --- a/lib/cr_vmware_tpl/__init__.py +++ b/lib/cr_vmware_tpl/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '2.0.2' +__version__ = '2.0.3' # vim: ts=4 et list diff --git a/snippets/tpl.270.remove-uek.sh b/snippets/tpl.270.remove-uek.sh index b3e8d86..3d3de66 100644 --- a/snippets/tpl.270.remove-uek.sh +++ b/snippets/tpl.270.remove-uek.sh @@ -12,10 +12,21 @@ remove_uek_packages() { sed -i -e 's/^\(DEFAULTKERNEL=\).*/\1kernel/i' /etc/sysconfig/kernel - echo - log "Removing UEK packages ..." + if rpm -qa | grep -- -uek- >/dev/null ; then + + echo + log "Removing UEK packages ..." + + if yum remove -y *-uek-*; then + : + else + echo "[$(date)]: Could not remove UEK packages." | tee -a "${ERROR_POINTER}" + fi - yum remove -y *-uek-* + else + echo + echo "Removing UEK packages not necessary." + fi } diff --git a/snippets/tpl.280.dist-upgrade.sh b/snippets/tpl.280.dist-upgrade.sh new file mode 100644 index 0000000..ddc4ea2 --- /dev/null +++ b/snippets/tpl.280.dist-upgrade.sh @@ -0,0 +1,26 @@ +## !/bin/bash +#raw + +#----------------------------------------------------------- +dist_upgrade() { + + echo + echo "${HASH_LINE}" + echo "Calling dist_upgrade() ..." + echo + log "Upgrading all packages ..." + echo + + if yum upgrade -y ; then + : + else + echo "[$(date)]: Upgrading system not successful." | tee -a "${ERROR_POINTER}" + fi + +} + +dist_upgrade + +#end raw +## vim: ts=4 et list +