From a3e6b1ee1d495f8dae23175bf762378873d91507 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Wed, 25 Oct 2023 09:26:36 -0400 Subject: [PATCH 1/3] change generate_ssl wait_for_salt_minion --- setup/so-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-functions b/setup/so-functions index b64daaa92..fd5bc790f 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -1258,7 +1258,7 @@ generate_ssl() { # if the install type is a manager then we need to wait for the minion to be ready before trying # to run the ssl state since we need the minion to sign the certs if [[ "$install_type" =~ ^(EVAL|MANAGER|MANAGERSEARCH|STANDALONE|IMPORT|HELIXSENSOR)$ ]]; then - wait_for_salt_minion "$MINION_ID" "5" "$setup_log" || fail_setup + (wait_for_salt_minion "$MINION_ID" "5" '/dev/stdout' || fail_setup) 2>&1 | tee -a "$setup_log" fi info "Applying SSL state" logCmd "salt-call state.apply ssl -l info" From 6891a95254b62c1a5093e6b0d465d91975d6bba0 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 26 Oct 2023 13:02:39 -0400 Subject: [PATCH 2/3] remove wait_for_salt_minion from so-functions --- setup/so-functions | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index fd5bc790f..42402ad86 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2494,20 +2494,6 @@ wait_for_file() { return 1 } -wait_for_salt_minion() { - retry 60 5 "journalctl -u salt-minion.service | grep 'Minion is ready to receive requests'" >> "$setup_log" 2>&1 || fail_setup - local attempt=0 - # each attempts would take about 15 seconds - local maxAttempts=20 - until check_salt_minion_status; do - attempt=$((attempt+1)) - if [[ $attempt -eq $maxAttempts ]]; then - fail_setup - fi - sleep 10 - done -} - verify_setup() { info "Verifying setup" set -o pipefail From 7e8f3b753f27df1b0bad2925fe7509d9aeb09ee0 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 26 Oct 2023 13:19:04 -0400 Subject: [PATCH 3/3] add minion name to log, update comment --- salt/common/tools/sbin/so-common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 87f40c9d4..bfa61f1b7 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -152,12 +152,12 @@ check_salt_master_status() { return 0 } -# this is only intended to be used to check the status of the minion +# this is only intended to be used to check the status of the minion from a salt master check_salt_minion_status() { local minion="$1" local timeout="${2:-5}" local logfile="${3:-'/dev/stdout'}" - echo "Checking if the salt minion will respond to jobs" >> "$logfile" 2>&1 + echo "Checking if the salt minion: $minion will respond to jobs" >> "$logfile" 2>&1 salt "$minion" test.ping -t $timeout > /dev/null 2>&1 local status=$? if [ $status -gt 0 ]; then