further improvements

This commit is contained in:
Jason Ertel
2023-01-20 11:23:13 -05:00
parent 1e4f9c9f26
commit c3384d8381
3 changed files with 11 additions and 20 deletions

View File

@@ -2380,3 +2380,11 @@ wait_for_file() {
wait_for_salt_minion() { wait_for_salt_minion() {
retry 60 5 "journalctl -u salt-minion.service | grep 'Minion is ready to receive requests'" >> "$setup_log" 2>&1 || exit 1 retry 60 5 "journalctl -u salt-minion.service | grep 'Minion is ready to receive requests'" >> "$setup_log" 2>&1 || exit 1
} }
verify_setup() {
if logCmd ./so-verify "$setup_type"; then
whiptail_setup_complete
else
whiptail_setup_failed
fi
}

View File

@@ -585,7 +585,7 @@ if ! [[ -f $install_opt_file ]]; then
fi fi
checkin_at_boot checkin_at_boot
set_initial_firewall_access set_initial_firewall_access
logCmd ./so-verify $setup_type verify_setup
else else
touch /root/accept_changes touch /root/accept_changes
mkdir -p /opt/so mkdir -p /opt/so
@@ -608,10 +608,8 @@ if ! [[ -f $install_opt_file ]]; then
configure_minion "$minion_type" configure_minion "$minion_type"
drop_install_options drop_install_options
checkin_at_boot checkin_at_boot
logCmd ./so-verify $setup_type verify_setup
fi fi
# Need to make sure the latest install is located on the web server of the manager to check the versions and donwload the code if required # Need to make sure the latest install is located on the web server of the manager to check the versions and donwload the code if required
fi fi

View File

@@ -9,15 +9,10 @@ cd "$(dirname "$0")" || exit 255
source ../salt/common/tools/sbin/so-common source ../salt/common/tools/sbin/so-common
source ./so-functions source ./so-functions
source ./so-whiptail
source ./so-variables source ./so-variables
setup_type=$1 setup_type=$1
setup_in_progress() {
ps -ef | grep so-setup | grep -v grep &> /dev/null
}
using_iso() { using_iso() {
if [ "$setup_type" == "iso" ]; then if [ "$setup_type" == "iso" ]; then
return 0 return 0
@@ -25,14 +20,6 @@ using_iso() {
return 0 return 0
} }
whipit() {
if [[ $exit_code -eq 0 ]]; then
whiptail_setup_complete
else
whiptail_setup_failed
fi
}
# Check entire setup log for errors or unexpected salt states # Check entire setup log for errors or unexpected salt states
log_has_errors() { log_has_errors() {
# Ignore salt mast cached public key and minion failed to auth because this is a test # Ignore salt mast cached public key and minion failed to auth because this is a test
@@ -44,7 +31,7 @@ log_has_errors() {
# Ignore Failed: 0 since that is the salt state output, and we detect state failures # Ignore Failed: 0 since that is the salt state output, and we detect state failures
# via Result: False already. # via Result: False already.
grep -E "FAILED|Failed|failed|ERROR|Error|Result: False" "$setup_log" | \ grep -E "FAILED|Failed|failed|ERROR|Error|Result: False" "$setup_log" | \
grep -vE "The Salt Master has cached the public key for this node" | \ grep -vE "The Salt Master has cached the public key for this node" | \
grep -vE "Minion failed to authenticate with the master" | \ grep -vE "Minion failed to authenticate with the master" | \
@@ -105,8 +92,6 @@ main() {
echo "Successfully completed setup!" echo "Successfully completed setup!"
fi fi
setup_in_progress && whipit $exit_code
exit $exit_code exit $exit_code
} }