From 65440f9aef91dd76f246a9db85f69388269041c7 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 17 Nov 2020 09:51:28 -0500 Subject: [PATCH] verify new salt version is installed during soup if not, exit before proceeding --- salt/common/tools/sbin/soup | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/salt/common/tools/sbin/soup b/salt/common/tools/sbin/soup index 1f3153d41..5ce777aa3 100755 --- a/salt/common/tools/sbin/soup +++ b/salt/common/tools/sbin/soup @@ -458,6 +458,20 @@ if [ "$UPGRADESALT" == "1" ]; then upgrade_salt fi +echo "Checking if Salt was upgraded." +echo "" +# Check that Salt was upgraded, should be 3 'salt' packages on a manager node. salt-minion, salt-master and salt or salt-common depending on Ubuntu or CentOS. we could add salt-syndic in the future so checking that there are at least 3 packages +if [[ `rpm -qa | grep salt | grep $NEWSALTVERSION | wc -l` < 3 ]]; then + echo "Salt upgrade failed. Check of indicators of failure in $SOUP_LOG." + echo "Once the issue is resolved, run soup again." + echo "Exiting." + echo "" + exit 1 +else + echo "Salt upgrade success." + echo "" +fi + echo "Making pillar changes." pillar_changes echo ""