Soup Update

This commit is contained in:
Mike Reeves
2020-07-18 22:58:15 -04:00
parent 7b1ca5f361
commit fbc8a90083

View File

@@ -23,7 +23,7 @@ default_salt_dir=/opt/so/saltstack/default
manager_check() { manager_check() {
# Check to see if this is a manager # Check to see if this is a manager
MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}') MANAGERCHECK=$(cat /etc/salt/grains | grep role | awk '{print $2}')
if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-managersearch')$ ]]; then if [[ "$MANAGERCHECK" =~ ^('so-eval'|'so-manager'|'so-standalone'|'so-managersearch')$ ]]; then
echo "This is a manager. We can proceed" echo "This is a manager. We can proceed"
else else
echo "Please run soup on the manager. The manager controls all updates." echo "Please run soup on the manager. The manager controls all updates."
@@ -169,15 +169,25 @@ verify_latest_update_script() {
fi fi
} }
echo "Checking to see if this is a manager"
manager_check manager_check
echo "Cloning latest code to a temporary location"
clone_to_tmp clone_to_tmp
echo "Verifying we have the latest script"
verify_latest_update_script verify_latest_update_script
echo "Let's see if we need to update"
upgrade_check upgrade_check
echo "Making pillar changes"
pillar_changes pillar_changes
echo "Cleaning up old docker"
clean_dockers clean_dockers
echo "Updating docker to $NEWVERSION"
update_dockers update_dockers
echo "Copying new code"
copy_new_files copy_new_files
echo "Running a highstate to complete upgrade"
highstate highstate
echo "Updating version"
update_version update_version
echo "" echo ""
echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete." echo "Upgrade from $INSTALLEDVERSION to $NEWVERSION complete."