mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
bootstrap-salt.sh: fix for silently ignored version argument on CentOS/RHEL
This commit adds a warning when a pre-existing saltstack.repo on CentOS/RHEL causes the version argument to be ignored. It also allows the -F (forced overwrite) option to override this situation, overwriting the saltstack.repo file, and thus installing the specified version. Resolves #1209.
This commit is contained in:
parent
e6aa6d7830
commit
aa52ca51dd
1 changed files with 4 additions and 1 deletions
|
@ -3550,7 +3550,7 @@ __install_saltstack_rhel_repository() {
|
||||||
gpg_key="SALTSTACK-GPG-KEY.pub"
|
gpg_key="SALTSTACK-GPG-KEY.pub"
|
||||||
repo_file="/etc/yum.repos.d/saltstack.repo"
|
repo_file="/etc/yum.repos.d/saltstack.repo"
|
||||||
|
|
||||||
if [ ! -s "$repo_file" ]; then
|
if [ ! -s "$repo_file" ] || [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; then
|
||||||
cat <<_eof > "$repo_file"
|
cat <<_eof > "$repo_file"
|
||||||
[saltstack]
|
[saltstack]
|
||||||
name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever
|
name=SaltStack ${repo_rev} Release Channel for RHEL/CentOS \$releasever
|
||||||
|
@ -3564,6 +3564,9 @@ _eof
|
||||||
|
|
||||||
fetch_url="${HTTP_VAL}://${_REPO_URL}/yum/redhat/${DISTRO_MAJOR_VERSION}/${CPU_ARCH_L}/${repo_rev}/"
|
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
|
||||||
|
elif [ "$repo_rev" != "latest" ]; then
|
||||||
|
echowarn "saltstack.repo already exists, ignoring salt version argument."
|
||||||
|
echowarn "Use -F (forced overwrite) to install $repo_rev."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue