Merge pull request #1068 from vutny/fix-1067

Fix configuring SaltStack's repo URL for RHEL variants
This commit is contained in:
Nicole Thomas 2017-05-05 11:16:29 -06:00 committed by GitHub
commit 104bf499f1

View file

@ -1539,7 +1539,6 @@ if [ "${DISTRO_NAME_L}" = "ubuntu" ]; then
fi fi
#--- FUNCTION ------------------------------------------------------------------------------------------------------- #--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: __function_defined # NAME: __function_defined
# DESCRIPTION: Checks if a function is defined within this scripts scope # DESCRIPTION: Checks if a function is defined within this scripts scope
@ -3579,14 +3578,9 @@ __install_saltstack_rhel_repository() {
repo_rev="latest" repo_rev="latest"
fi fi
# Cloud Linux $releasever = 7.x, which doesn't exist in repo.saltstack.com, we need this to be "7" # Avoid using '$releasever' variable for yum.
if [ "${DISTRO_NAME}" = "Cloud Linux" ] && [ "${DISTRO_MAJOR_VERSION}" = "7" ]; then # Instead, this should work correctly on all RHEL variants.
base_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/" base_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/"
else
base_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/\$releasever/\$basearch/${repo_rev}/"
fi
fetch_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${repo_rev}/"
if [ "${DISTRO_MAJOR_VERSION}" -eq 5 ]; then if [ "${DISTRO_MAJOR_VERSION}" -eq 5 ]; then
gpg_key="SALTSTACK-EL5-GPG-KEY.pub" gpg_key="SALTSTACK-EL5-GPG-KEY.pub"
@ -3607,16 +3601,10 @@ enabled=1
enabled_metadata=1 enabled_metadata=1
_eof _eof
fetch_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${repo_rev}/"
__rpm_import_gpg "${fetch_url}${gpg_key}" || return 1 __rpm_import_gpg "${fetch_url}${gpg_key}" || return 1
fi fi
if [ "$DISTRO_MAJOR_VERSION" -eq 7 ] && ([ "$repo_rev" = "latest" ] || [ "$repo_rev" = "2015.8" ]); then
# Import CentOS 7 GPG key on RHEL for installing base dependencies from
# Salt corporate repository
rpm -qa gpg-pubkey\* --qf "%{name}-%{version}\n" | grep -q ^gpg-pubkey-f4a80eb5$ || \
__rpm_import_gpg "${HTTP_VAL}://${_REPO_URL}/yum/redhat/7/x86_64/${repo_rev}/base/RPM-GPG-KEY-CentOS-7" || return 1
fi
return 0 return 0
} }
@ -4478,7 +4466,6 @@ daemons_running_alpine_linux() {
# #
install_amazon_linux_ami_deps() { install_amazon_linux_ami_deps() {
# Shim to figure out if we're using old (rhel) or new (aws) rpms. # Shim to figure out if we're using old (rhel) or new (aws) rpms.
_USEAWS=$BS_FALSE _USEAWS=$BS_FALSE