Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap fixes for 3006 #1900

Merged
merged 7 commits into from
Mar 10, 2023
44 changes: 35 additions & 9 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,11 @@ elif [ "$ITYPE" = "onedir_rc" ]; then
#ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
ONEDIR_REV="minor/$1"
shift
elif [ "$(echo "$1" | grep -E '^([3-9][0-9]{3}\.[0-9]?rc[0-9]$)')" != "" ]; then
# Handle the 3xxx.0 version as 3xxx archive (pin to minor) and strip the fake ".0" suffix
#ONEDIR_REV=$(echo "$1" | sed -E 's/^([3-9][0-9]{3})\.0$/\1/')
ONEDIR_REV="minor/$1"
shift
else
echo "Unknown onedir_rc version: $1 (valid: 3005-1, latest.)"
exit 1
Expand Down Expand Up @@ -3073,7 +3078,11 @@ __install_saltstack_ubuntu_onedir_repository() {
fi
echo "$__REPO_ARCH_DEB $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > /etc/apt/sources.list.d/salt.list

__apt_key_fetch "${SALTSTACK_UBUNTU_URL}salt-archive-keyring.gpg" || return 1
if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005|nightly)')" != "" ]; then
__apt_key_fetch "${SALTSTACK_UBUNTU_URL}salt-archive-keyring.gpg" || return 1
else
__apt_key_fetch "${SALTSTACK_UBUNTU_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1
fi

__wait_for_apt apt-get update || return 1
}
Expand Down Expand Up @@ -3613,7 +3622,11 @@ __install_saltstack_debian_onedir_repository() {
fi
echo "$__REPO_ARCH_DEB $SALTSTACK_DEBIAN_URL $DEBIAN_CODENAME main" > "/etc/apt/sources.list.d/salt.list"

__apt_key_fetch "${SALTSTACK_DEBIAN_URL}salt-archive-keyring.gpg" || return 1
if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005|nightly)')" != "" ]; then
__apt_key_fetch "${SALTSTACK_DEBIAN_URL}salt-archive-keyring.gpg" || return 1
else
__apt_key_fetch "${SALTSTACK_DEBIAN_URL}SALT-PROJECT-GPG-PUBKEY-2023.gpg" || return 1
fi

__wait_for_apt apt-get update || return 1
}
Expand Down Expand Up @@ -4497,10 +4510,14 @@ __install_saltstack_rhel_onedir_repository() {
if [ "${ONEDIR_REV}" = "nightly" ] ; then
base_url="${HTTP_VAL}://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/"
fi
if [ "${DISTRO_MAJOR_VERSION}" -eq 9 ]; then
gpg_key="SALTSTACK-GPG-KEY2.pub"
if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005|nightly)')" != "" ]; then
if [ "${DISTRO_MAJOR_VERSION}" -eq 9 ]; then
gpg_key="SALTSTACK-GPG-KEY2.pub"
else
gpg_key="SALTSTACK-GPG-KEY.pub"
fi
else
gpg_key="SALTSTACK-GPG-KEY.pub"
gpg_key="SALT-PROJECT-GPG-PUBKEY-2023.pub"
fi

gpg_key_urls=""
Expand Down Expand Up @@ -6278,9 +6295,14 @@ install_amazon_linux_ami_2_onedir_deps() {
if [ "${ONEDIR_REV}" = "nightly" ] ; then
base_url="$HTTP_VAL://${_REPO_URL}/${_ONEDIR_NIGHTLY_DIR}/${__PY_VERSION_REPO}/amazon/2/\$basearch/"
fi
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7"
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub"

if [ "$(echo "${ONEDIR_REV}" | grep -E '(3004|3005|nightly)')" != "" ]; then
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7"
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub"
fi
else
gpg_key="${base_url}SALTSTACK-GPG-PUBKEY-2023.pub"
fi

# This should prob be refactored to use __install_saltstack_rhel_repository()
Expand Down Expand Up @@ -8652,7 +8674,11 @@ daemons_running_onedir() {
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue

salt_path="/opt/saltstack/salt/run/run ${fname}"
if [ -f "/opt/saltstack/salt/run/run" ]; then
salt_path="/opt/saltstack/salt/run/run ${fname}"
else
salt_path="salt-${fname}"
fi
process_running=$(pgrep -f "${salt_path}")
if [ "${process_running}" = "" ]; then
echoerror "${salt_path} was not found running"
Expand Down