From 33fdc239659ef2022a2fd82c4c5ab09088b04776 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 12 Nov 2024 11:31:42 -0500 Subject: [PATCH 1/2] remove salt repo files created by saltbootstrap --- salt/common/soup_scripts.sls | 2 +- salt/salt/minion.sls | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/salt/common/soup_scripts.sls b/salt/common/soup_scripts.sls index c5b75b0f2..60215f949 100644 --- a/salt/common/soup_scripts.sls +++ b/salt/common/soup_scripts.sls @@ -114,7 +114,7 @@ copy_so-repo-sync_sbin: {% if grains.os_family == 'Debian' %} {% set saltrepofile = '/etc/apt/sources.list.d/salt.list' %} {% endif %} -remove_saltproject_io_repo: +remove_saltproject_io_repo_manager: file.absent: - name: {{ saltrepofile }} {% endif %} diff --git a/salt/salt/minion.sls b/salt/salt/minion.sls index a5953e8e1..ee7c1f14c 100644 --- a/salt/salt/minion.sls +++ b/salt/salt/minion.sls @@ -19,6 +19,17 @@ include: {% if INSTALLEDSALTVERSION|string != SALTVERSION|string %} +{# this is added in 2.4.120 to remove salt repo files pointing to saltproject.io to accomodate the move to broadcom and new bootstrap-salt script #} +{% if salt['pkg.version_cmp'](GLOBALS.so_version, '2.4.120') == -1 %} +{% set saltrepofile = '/etc/yum.repos.d/salt.repo' %} +{% if grains.os_family == 'Debian' %} +{% set saltrepofile = '/etc/apt/sources.list.d/salt.list' %} +{% endif %} +remove_saltproject_io_repo_minion: + file.absent: + - name: {{ saltrepofile }} +{% endif %} + unhold_salt_packages: pkg.unheld: - pkgs: From b1ddaa72116b64d5bdeea681851a565162b3a558 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Thu, 14 Nov 2024 09:07:41 -0500 Subject: [PATCH 2/2] support installing specified version for rhel variants. remove bootstrap -x python3 since not needed --- salt/manager/tools/sbin/soup | 6 +++--- salt/salt/map.jinja | 4 ++-- salt/salt/scripts/bootstrap-salt.sh | 13 +++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/salt/manager/tools/sbin/soup b/salt/manager/tools/sbin/soup index bd2db98d7..222adae95 100755 --- a/salt/manager/tools/sbin/soup +++ b/salt/manager/tools/sbin/soup @@ -1003,12 +1003,12 @@ upgrade_salt() { # if oracle run with -r to ignore repos set by bootstrap if [[ $OS == 'oracle' ]]; then run_check_net_err \ - "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -r -F -M -x python3 stable \"$NEWSALTVERSION\"" \ + "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -r -F -M stable \"$NEWSALTVERSION\"" \ "Could not update salt, please check $SOUP_LOG for details." # if another rhel family variant we want to run without -r to allow the bootstrap script to manage repos else run_check_net_err \ - "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -F -M -x python3 stable \"$NEWSALTVERSION\"" \ + "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -F -M stable \"$NEWSALTVERSION\"" \ "Could not update salt, please check $SOUP_LOG for details." fi set -e @@ -1028,7 +1028,7 @@ upgrade_salt() { echo "" set +e run_check_net_err \ - "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -F -M -x python3 stable \"$NEWSALTVERSION\"" \ + "sh $UPDATE_DIR/salt/salt/scripts/bootstrap-salt.sh -X -F -M stable \"$NEWSALTVERSION\"" \ "Could not update salt, please check $SOUP_LOG for details." set -e echo "Applying apt hold for Salt." diff --git a/salt/salt/map.jinja b/salt/salt/map.jinja index cc388edb4..8feb06763 100644 --- a/salt/salt/map.jinja +++ b/salt/salt/map.jinja @@ -15,9 +15,9 @@ {% if grains.saltversion|string != SALTVERSION|string %} {% if grains.os_family|lower == 'redhat' %} - {% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -s 120 -r -F -x python3 stable ' ~ SALTVERSION %} + {% set UPGRADECOMMAND = 'yum clean all ; /usr/sbin/bootstrap-salt.sh -s 120 -r -F stable ' ~ SALTVERSION %} {% elif grains.os_family|lower == 'debian' %} - {% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -s 120 -F -x python3 stable ' ~ SALTVERSION %} + {% set UPGRADECOMMAND = '/usr/sbin/bootstrap-salt.sh -s 120 -F stable ' ~ SALTVERSION %} {% endif %} {% else %} {% set UPGRADECOMMAND = 'echo Already running Salt Minion version ' ~ SALTVERSION %} diff --git a/salt/salt/scripts/bootstrap-salt.sh b/salt/salt/scripts/bootstrap-salt.sh index e6b25f2d3..4e65008dc 100644 --- a/salt/salt/scripts/bootstrap-salt.sh +++ b/salt/salt/scripts/bootstrap-salt.sh @@ -4420,29 +4420,30 @@ install_centos_onedir_deps() { } install_centos_onedir() { + yum clean metadata + yum makecache __PACKAGES="" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then - __PACKAGES="${__PACKAGES} salt-cloud" + __PACKAGES="${__PACKAGES} salt-cloud-${STABLE_REV}" fi if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then - __PACKAGES="${__PACKAGES} salt-master" + __PACKAGES="${__PACKAGES} salt-master-${STABLE_REV}" fi if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then - __PACKAGES="${__PACKAGES} salt-minion" + __PACKAGES="${__PACKAGES} salt-minion-${STABLE_REV}" fi if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then - __PACKAGES="${__PACKAGES} salt-syndic" + __PACKAGES="${__PACKAGES} salt-syndic-${STABLE_REV}" fi if [ "$_INSTALL_SALT_API" -eq $BS_TRUE ]; then - __PACKAGES="${__PACKAGES} salt-api" + __PACKAGES="${__PACKAGES} salt-api-${STABLE_REV}" fi # shellcheck disable=SC2086 __yum_install_noinput ${__PACKAGES} || return 1 - return 0 }