Fix soup to clear yum cache for airgap

This commit is contained in:
Mike Reeves
2020-11-04 10:00:44 -05:00
committed by GitHub
parent cf001875c2
commit ec64314b70

View File

@@ -140,9 +140,9 @@ detect_os() {
} }
highstate() { highstate() {
# Run a highstate but first cancel a running one. # Run a highstate.
salt-call saltutil.kill_all_jobs echo "Running a highstate. This could take a few minutes"
salt-call state.highstate -l info salt-call state.highstate -l info queue=True
} }
masterlock() { masterlock() {
@@ -529,6 +529,7 @@ if [ "$UPGRADESALT" == "1" ]; then
# Update the repo files so it can actually upgrade # Update the repo files so it can actually upgrade
if [ $is_airgap -eq 0 ]; then if [ $is_airgap -eq 0 ]; then
update_centos_repo update_centos_repo
yum clean all
fi fi
upgrade_salt upgrade_salt
fi fi
@@ -575,10 +576,12 @@ highstate
playbook playbook
unmount_update unmount_update
SALTUPGRADED="True" if [ "$UPGRADESALT" == "1" ]; then
if [[ "$SALTUPGRADED" == "True" ]]; then
echo "" echo ""
echo "Upgrading Salt on the remaining Security Onion nodes from $INSTALLEDSALTVERSION to $NEWSALTVERSION." echo "Upgrading Salt on the remaining Security Onion nodes from $INSTALLEDSALTVERSION to $NEWSALTVERSION."
if [ $is_airgap -eq 0 ]; then
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' cmd.run "yum clean all"
fi
salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion salt -C 'not *_eval and not *_helix and not *_manager and not *_managersearch and not *_standalone' -b $BATCHSIZE state.apply salt.minion
echo "" echo ""
fi fi