mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 01:30:21 +00:00
fix fetch url
This commit is contained in:
parent
b5c022a4fb
commit
3b43309236
1 changed files with 15 additions and 4 deletions
|
@ -4121,10 +4121,19 @@ __install_saltstack_rhel_repository() {
|
|||
# Instead, this should work correctly on all RHEL variants.
|
||||
base_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/"
|
||||
if [ "${DISTRO_MAJOR_VERSION}" -eq 7 ]; then
|
||||
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub,${base_url}base/RPM-GPG-KEY-CentOS-7"
|
||||
gpg_key="SALTSTACK-GPG-KEY.pub,base/RPM-GPG-KEY-CentOS-7"
|
||||
else
|
||||
gpg_key="${base_url}SALTSTACK-GPG-KEY.pub"
|
||||
gpg_key="SALTSTACK-GPG-KEY.pub"
|
||||
fi
|
||||
|
||||
Field_Separator=$IFS
|
||||
IFS=,
|
||||
gpg_key_urls=""
|
||||
for key in $gpg_key; do
|
||||
gpg_key_urls+="${base_url}${key},"
|
||||
done
|
||||
IFS=$Field_Separator
|
||||
|
||||
repo_file="/etc/yum.repos.d/salt.repo"
|
||||
|
||||
if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then
|
||||
|
@ -4134,17 +4143,19 @@ name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever
|
|||
baseurl=${base_url}
|
||||
skip_if_unavailable=True
|
||||
gpgcheck=1
|
||||
gpgkey=${gpg_key}
|
||||
gpgkey=${gpg_key_urls}
|
||||
enabled=1
|
||||
enabled_metadata=1
|
||||
_eof
|
||||
|
||||
fetch_url="${HTTP_VAL}://${_REPO_URL}/${__PY_VERSION_REPO}/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${repo_rev}/"
|
||||
Field_Separator=$IFS
|
||||
IFS=,
|
||||
for key in $gpg_key; do
|
||||
__rpm_import_gpg "$key" || return 1
|
||||
__rpm_import_gpg "${fetch_url}${key}" || return 1
|
||||
done
|
||||
IFS=$Field_Separator
|
||||
|
||||
yum clean metadata || return 1
|
||||
elif [ "$repo_rev" != "latest" ]; then
|
||||
echowarn "salt.repo already exists, ignoring salt version argument."
|
||||
|
|
Loading…
Add table
Reference in a new issue