Merge pull request #12135 from max-arnold/salt-bootstrap-nix

Modernize Salt bootstrap script
This commit is contained in:
Sophia Castellarin 2021-02-04 15:53:51 -06:00 committed by GitHub
commit 9307d4b0dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,13 +4,16 @@ cd `mktemp -d`
# We just download the bootstrap script by default and execute that.
if [ -x /usr/bin/fetch ]; then
/usr/bin/fetch -o bootstrap-salt.sh https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh
/usr/bin/fetch -o bootstrap-salt.sh https://bootstrap.saltproject.io
elif [ -x /usr/bin/curl ]; then
/usr/bin/curl --silent --show-error -L -O https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh
/usr/bin/curl --silent --show-error -L --output bootstrap-salt.sh https://bootstrap.saltproject.io
elif [ -x /usr/bin/wget ]; then
/usr/bin/wget -O bootstrap-salt.sh https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh
/usr/bin/wget -O bootstrap-salt.sh https://bootstrap.saltproject.io
elif [ "2" = `python -c 'import sys; sys.stdout.write(str(sys.version_info.major))'` ]; then
# TODO: remove after there is no supported distros with Python 2
python -c 'import urllib; urllib.urlretrieve("https://bootstrap.saltproject.io", "bootstrap-salt.sh")'
else
python -c 'import urllib; urllib.urlretrieve("https://raw.githubusercontent.com/saltstack/salt-bootstrap/stable/bootstrap-salt.sh", "bootstrap-salt.sh")'
python -c 'import urllib.request; urllib.request.urlretrieve("https://bootstrap.saltproject.io", "bootstrap-salt.sh")'
fi
if [ -e bootstrap-salt.sh ]; then