From cc19b601462df1b3e95adc5d22cfb91bb5bf8f22 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 15 Oct 2024 09:32:14 -0400 Subject: [PATCH] restore services/top at start of soup --- salt/manager/tools/sbin/soup | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index 091e471d4..6826bde2f 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -32,10 +32,7 @@ check_err() { if [[ $exit_code -ne 0 ]]; then set +e - systemctl_func "start" "$cron_service_name" - systemctl_func "start" "salt-master" - systemctl_func "start" "salt-minion" - enable_highstate + failed_soup_restore_items printf '%s' "Soup failed with error $exit_code: " case $exit_code in @@ -358,8 +355,12 @@ masterlock() { } masterunlock() { - echo "Unlocking Salt Master" - mv -v $BACKUPTOPFILE $TOPFILE + if [ -f $BACKUPTOPFILE ]; then + echo "Unlocking Salt Master" + mv -v $BACKUPTOPFILE $TOPFILE + else + echo "Salt Master does not need unlocked." + fi } phases_pillar_2_4_80() { @@ -1079,6 +1080,13 @@ apply_hotfix() { fi } +failed_soup_restore_items() { + systemctl_func "start" "$cron_service_name" + systemctl_func "start" "salt-master" + systemctl_func "start" "salt-minion" + enable_highstate + masterunlock +} #upgrade salt to 3004.1 #2_3_10_hotfix_1() { @@ -1118,6 +1126,8 @@ main() { echo "" require_manager + failed_soup_restore_items + check_pillar_items echo "Checking to see if this is an airgap install."