From 5250292e95361427f04b1df2a60505bb47874cc5 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 12 Oct 2023 15:54:22 -0400 Subject: [PATCH] only allow stable install type. require -r to be used --- salt/salt/scripts/bootstrap-salt.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/salt/salt/scripts/bootstrap-salt.sh b/salt/salt/scripts/bootstrap-salt.sh index d422a5295..f56d6b17b 100644 --- a/salt/salt/scripts/bootstrap-salt.sh +++ b/salt/salt/scripts/bootstrap-salt.sh @@ -611,6 +611,19 @@ if [ "$(echo "$ITYPE" | grep -E '(stable|testing|git|onedir|onedir_rc|old-stable exit 1 fi +# Due to our modifications to install_centos_onedir it is easiest to just lock down to only allowing stable install +if [ "$(echo "$ITYPE" | grep stable)" = "" ]; then + echoerror "This script has been modified to only support stable installation type..." + exit 1 +fi + +# We want to require this script to only run with -r. We dont want to accidentally try to install from another repo +# and we dont want to put salt.repo in /etc/yum.repos.d/ +if [ "$_DISABLE_REPOS" -eq $BS_FALSE ];then + echoerror "This script has been modified to required the usage of the -r flag which disables this script from using its own repos..." + exit 1 +fi + # If doing a git install, check what branch/tag/sha will be checked out if [ "$ITYPE" = "git" ]; then if [ "$#" -eq 0 ];then @@ -5123,6 +5136,8 @@ install_centos_onedir_deps() { return 0 } +# This function has been modified to allow for specific versions to be installed +# when not using the salt repo install_centos_onedir() { __PACKAGES="" @@ -5130,11 +5145,7 @@ install_centos_onedir() { local master='salt-master' local minion='salt-minion' local syndic='salt-syndic' - if [ "$ITYPE" = "stable" ]; then - local ver="$_ONEDIR_REV" - elif [ "$ITYPE" = "onedir" ]; then - local ver="${ONEDIR_REV##*/}" - fi + local ver="$_ONEDIR_REV" if [ ! -z $ver ]; then cloud+="-$ver"