mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
ensure salt-master service is running before proceeding with soup
This commit is contained in:
@@ -120,6 +120,30 @@ check_elastic_license() {
|
||||
fi
|
||||
}
|
||||
|
||||
check_salt_master_status() {
|
||||
local timeout=$1
|
||||
echo "Checking if we can talk to the salt master"
|
||||
salt-call state.show_top -t $timeout concurrent=true
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
check_salt_minion_status() {
|
||||
local timeout=$1
|
||||
echo "Checking if the salt minion will respond to jobs" >> "$setup_log" 2>&1
|
||||
salt "$MINION_ID" test.ping -t $timeout > /dev/null 2>&1
|
||||
local status=$?
|
||||
if [ $status -gt 0 ]; then
|
||||
echo " Minion did not respond" >> "$setup_log" 2>&1
|
||||
else
|
||||
echo " Received job response from salt minion" >> "$setup_log" 2>&1
|
||||
fi
|
||||
|
||||
retrun $status
|
||||
}
|
||||
|
||||
|
||||
|
||||
copy_new_files() {
|
||||
# Copy new files over to the salt dir
|
||||
cd $UPDATE_DIR
|
||||
|
||||
@@ -1018,6 +1018,12 @@ main() {
|
||||
echo ""
|
||||
require_manager
|
||||
|
||||
if ! check_salt_master_status -t 30; then
|
||||
echo "Could not talk to salt master"
|
||||
echo "Please run `systemctl status salt-master` to ensure the salt-master service is running."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
check_pillar_items
|
||||
|
||||
echo "Checking to see if this is an airgap install."
|
||||
|
||||
@@ -232,36 +232,6 @@ check_service_status() {
|
||||
|
||||
}
|
||||
|
||||
check_salt_master_status() {
|
||||
local timeout=$1
|
||||
echo "Checking if we can talk to the salt master" >> "$setup_log" 2>&1
|
||||
salt-call saltutil.kill_all_jobs > /dev/null 2>&1
|
||||
salt-call state.show_top -t $timeout > /dev/null 2>&1
|
||||
local status=$?
|
||||
if [ $status -gt 0 ]; then
|
||||
echo " Could not talk to salt master" >> "$setup_log" 2>&1
|
||||
return 1;
|
||||
else
|
||||
echo " Can talk to salt master" >> "$setup_log" 2>&1
|
||||
return 0;
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_salt_minion_status() {
|
||||
local timeout=$1
|
||||
echo "Checking if the salt minion will respond to jobs" >> "$setup_log" 2>&1
|
||||
salt "$MINION_ID" test.ping -t $timeout > /dev/null 2>&1
|
||||
local status=$?
|
||||
if [ $status -gt 0 ]; then
|
||||
echo " Minion did not respond" >> "$setup_log" 2>&1
|
||||
return 1;
|
||||
else
|
||||
echo " Received job response from salt minion" >> "$setup_log" 2>&1
|
||||
return 0;
|
||||
fi
|
||||
}
|
||||
|
||||
check_soremote_pass() {
|
||||
check_pass_match "$SOREMOTEPASS1" "$SOREMOTEPASS2" "SCMATCH"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user