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() {
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
checkin_at_boot
set_initial_firewall_access
logCmd ./so-verify $setup_type
verify_setup
else
touch /root/accept_changes
mkdir -p /opt/so
@@ -608,10 +608,8 @@ if ! [[ -f $install_opt_file ]]; then
configure_minion "$minion_type"
drop_install_options
checkin_at_boot
logCmd ./so-verify $setup_type
verify_setup
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
fi

View File

@@ -9,15 +9,10 @@ cd "$(dirname "$0")" || exit 255
source ../salt/common/tools/sbin/so-common
source ./so-functions
source ./so-whiptail
source ./so-variables
setup_type=$1
setup_in_progress() {
ps -ef | grep so-setup | grep -v grep &> /dev/null
}
using_iso() {
if [ "$setup_type" == "iso" ]; then
return 0
@@ -25,14 +20,6 @@ using_iso() {
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
log_has_errors() {
# Ignore salt mast cached public key and minion failed to auth because this is a test
@@ -105,8 +92,6 @@ main() {
echo "Successfully completed setup!"
fi
setup_in_progress && whipit $exit_code
exit $exit_code
}