Skip to content

Commit 2bdcfa3

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into stable
2 parents 13b8215 + a602a86 commit 2bdcfa3

File tree

4 files changed

+175
-32
lines changed

4 files changed

+175
-32
lines changed

AUTHORS.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,12 @@ Brandon Clifford brandon099 [email protected]
3030
Bret Fisher BretFisher [email protected]
3131
Brian Kruger bkruger99 [email protected]
3232
bruce-one bruce-one
33-
Вячеслав Спиридонов sp1r
33+
Bryce Larson bryceml
3434
C. R. Oldham cro [email protected]
3535
Cam camereonsparr
3636
Charles McLaughlin cmclaughlin
37-
Megan Wilhite Ch3LL [email protected]
38-
Chris Rebert cvrebert [email protected]
3937
Chris Buechler cbuechler [email protected]
38+
Chris Rebert cvrebert [email protected]
4039
Christer Edwards cedwards
4140
Christian McHugh mchugh19
4241
Clark Perkins iclarkperkins [email protected]
@@ -60,22 +59,24 @@ Eric Radman eradman [email protected]
6059
Erik Ankrom erikankrom
6160
Erik Johnson terminalmage [email protected]
6261
EYJ eyj
62+
Felippe Burk felippeb
6363
fizmat fizmat
6464
Forrest Alvarez gravyboat
6565
Fred Reimer freimer [email protected]
6666
Gareth J. Greenaway garethgreenaway [email protected]
67+
gdm85 gdm85
6768
Geoff Garside geoffgarside [email protected]
6869
George aflat [email protected]
69-
gdm85 gdm85
7070
ggillies ggillies
7171
Giuseppe Iannello giannello [email protected]
7272
Gregory Meno GregMeno [email protected]
7373
Guillaume Derval GuillaumeDerval [email protected]
7474
gweis gweis
7575
Henrik Holmboe holmboe
7676
Howard Mei HowardMei [email protected]
77-
Jan Heidbrink jheidbrink
7877
James Booth absolutejam [email protected]
78+
Jan Heidbrink jheidbrink
79+
Jared Bristow jars99
7980
Jared E Stroud jaredestroud [email protected]
8081
Jasper Lievisse Adriaanse jasperla [email protected]
8182
JD decomposite
@@ -89,8 +90,8 @@ Karl Grzeszczak karlgrz
8990
Kenneth Wilke KennethWilke
9091
Kevin Quinn kevinquinnyo [email protected]
9192
Ky-Anh Huynh icy
92-
lomeroe lomeroe
9393
Liu Xiaohui oreh [email protected]
94+
lomeroe lomeroe
9495
Lorenzo Perone lopezio [email protected]
9596
Lubomir Host lhost
9697
luthes luthes [email protected]
@@ -106,6 +107,7 @@ Matthew Mead-Briggs mattmb
106107
Matthew Richardson mrichar1
107108
Matthew Willson ixela
108109
Matthieu Guegan mguegan
110+
Megan Wilhite Ch3LL [email protected]
109111
mfapouw mfapouw
110112
Michael A. Smith kojiromike [email protected]
111113
Michael Scherer mscherer
@@ -164,4 +166,6 @@ Wout wfhg
164166
Yann Masson ymasson
165167
Yoan Blanc greut [email protected]
166168
Yushi Nakai nyushi
169+
Zahiar Ahmed zahiar
170+
Вячеслав Спиридонов sp1r
167171
========================== ===================== ============================

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Version TBD (In Progress on the Develop Branch):
22

3+
Version 2019.10.03:
4+
* Fix possible typo with `gnupg-curl` vs `gnupg curl` (zahiar)
5+
* Install only python3 packges if requested on ubuntu (noelmcloughlin) #1356
6+
* Fixing debian wheezy (bryceml) #1359
7+
* Fixed Amazon Linux 2 detection when lsb_release is installed (jars99) #1361
8+
* Mac OS Support (felippeb) #1363 #1364 #1365 #1366
9+
310
Version 2019.05.20:
411
* Allow stable version selection for amazon linux (puluanau) #1328
512
* FreeBSD 12 support (sticky-note) #1329

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ sum** of the downloaded ``bootstrap-salt.sh`` file.
2828

2929
The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is:
3030

31+
- 2019.05.20: ``46fb5e4b7815efafd69fd703f033fe86e7b584b6770f7e0b936995bcae1cedd8``
3132
- 2019.02.27: ``23728e4b5e54f564062070e3be53c5602b55c24c9a76671968abbf3d609258cb``
3233
- 2019.01.08: ``ab7f29b75711da4bb79aff98d46654f910d569ebe3e908753a3c5119017bb163``
3334
- 2018.08.15: ``6d414a39439a7335af1b78203f9d37e11c972b3c49c519742c6405e2944c6c4b``

bootstrap-salt.sh

Lines changed: 157 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#======================================================================================================================
2424
set -o nounset # Treat unset variables as an error
2525

26-
__ScriptVersion="2019.05.20"
26+
__ScriptVersion="2019.10.03"
2727
__ScriptName="bootstrap-salt.sh"
2828

2929
__ScriptFullName="$0"
@@ -601,7 +601,11 @@ elif [ "$ITYPE" = "stable" ]; then
601601
STABLE_REV="$1"
602602
shift
603603
elif [ "$(echo "$1" | grep -E '^([0-9]*\.[0-9]*\.[0-9]*)$')" != "" ]; then
604-
STABLE_REV="archive/$1"
604+
if [ "$(uname)" = "Darwin" ]; then
605+
STABLE_REV="$1"
606+
else
607+
STABLE_REV="archive/$1"
608+
fi
605609
shift
606610
else
607611
echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, 2015.8, 2016.3, 2016.11, 2017.7, 2018.3, 2019.2, latest, \$MAJOR.\$MINOR.\$PATCH)"
@@ -667,7 +671,11 @@ fi
667671

668672
# Check if we're installing via a different Python executable and set major version variables
669673
if [ -n "$_PY_EXE" ]; then
670-
_PY_PKG_VER=$(echo "$_PY_EXE" | sed -r "s/\\.//g")
674+
if [ "$(uname)" = "Darwin" ]; then
675+
_PY_PKG_VER=$(echo "$_PY_EXE" | sed "s/\\.//g")
676+
else
677+
_PY_PKG_VER=$(echo "$_PY_EXE" | sed -r "s/\\.//g")
678+
fi
671679

672680
_PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7)
673681
if [ "$_PY_MAJOR_VERSION" != 3 ] && [ "$_PY_MAJOR_VERSION" != 2 ]; then
@@ -1001,7 +1009,7 @@ __gather_linux_system_info() {
10011009
elif [ "${DISTRO_NAME}" = "OracleServer" ]; then
10021010
# This the Oracle Linux Server 6.5
10031011
DISTRO_NAME="Oracle Linux"
1004-
elif [ "${DISTRO_NAME}" = "AmazonAMI" ]; then
1012+
elif [ "${DISTRO_NAME}" = "AmazonAMI" ] || [ "${DISTRO_NAME}" = "Amazon" ]; then
10051013
DISTRO_NAME="Amazon Linux AMI"
10061014
elif [ "${DISTRO_NAME}" = "ManjaroLinux" ]; then
10071015
DISTRO_NAME="Arch Linux"
@@ -1243,6 +1251,16 @@ __gather_bsd_system_info() {
12431251
}
12441252

12451253

1254+
#--- FUNCTION -------------------------------------------------------------------------------------------------------
1255+
# NAME: __gather_osx_system_info
1256+
# DESCRIPTION: Discover MacOS X
1257+
#----------------------------------------------------------------------------------------------------------------------
1258+
__gather_osx_system_info() {
1259+
DISTRO_NAME="MacOSX"
1260+
DISTRO_VERSION=$(sw_vers -productVersion)
1261+
}
1262+
1263+
12461264
#--- FUNCTION -------------------------------------------------------------------------------------------------------
12471265
# NAME: __gather_system_info
12481266
# DESCRIPTION: Discover which system and distribution we are running.
@@ -1258,6 +1276,9 @@ __gather_system_info() {
12581276
openbsd|freebsd|netbsd )
12591277
__gather_bsd_system_info
12601278
;;
1279+
darwin )
1280+
__gather_osx_system_info
1281+
;;
12611282
* )
12621283
echoerror "${OS_NAME} not supported.";
12631284
exit 1
@@ -1448,6 +1469,7 @@ __debian_derivatives_translation() {
14481469
linuxmint_1_debian_base="8.0"
14491470
raspbian_8_debian_base="8.0"
14501471
raspbian_9_debian_base="9.0"
1472+
raspbian_10_debian_base="10.0"
14511473
bunsenlabs_9_debian_base="9.0"
14521474
turnkey_9_debian_base="9.0"
14531475

@@ -2648,13 +2670,12 @@ __install_saltstack_ubuntu_repository() {
26482670
UBUNTU_CODENAME=${DISTRO_CODENAME}
26492671
fi
26502672

2651-
__PACKAGES=''
2652-
26532673
# Install downloader backend for GPG keys fetching
2654-
if [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then
2655-
__PACKAGES="${__PACKAGES} gnupg dirmngr"
2656-
else
2657-
__PACKAGES="${__PACKAGES} gnupg-curl"
2674+
__PACKAGES='wget'
2675+
2676+
# Required as it is not installed by default on Ubuntu 18+
2677+
if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then
2678+
__PACKAGES="${__PACKAGES} gnupg"
26582679
fi
26592680

26602681
# Make sure https transport is available
@@ -2698,6 +2719,12 @@ install_ubuntu_deps() {
26982719
__PACKAGES="upstart"
26992720
fi
27002721

2722+
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
2723+
PY_PKG_VER=3
2724+
else
2725+
PY_PKG_VER=""
2726+
fi
2727+
27012728
if [ "$DISTRO_MAJOR_VERSION" -ge 16 ] && [ -z "$_PY_EXE" ]; then
27022729
__PACKAGES="${__PACKAGES} python2.7"
27032730
fi
@@ -2706,13 +2733,13 @@ install_ubuntu_deps() {
27062733
__PACKAGES="${__PACKAGES} python-virtualenv"
27072734
fi
27082735
# Need python-apt for managing packages via Salt
2709-
__PACKAGES="${__PACKAGES} python-apt"
2736+
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt"
27102737

27112738
# requests is still used by many salt modules
2712-
__PACKAGES="${__PACKAGES} python-requests"
2739+
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-requests"
27132740

27142741
# YAML module is used for generating custom master/minion configs
2715-
__PACKAGES="${__PACKAGES} python-yaml"
2742+
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-yaml"
27162743

27172744
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
27182745
__PACKAGES="${__PACKAGES} procps pciutils"
@@ -3049,13 +3076,12 @@ __install_saltstack_debian_repository() {
30493076
__PY_VERSION_REPO="py3"
30503077
fi
30513078

3052-
__PACKAGES=''
3053-
30543079
# Install downloader backend for GPG keys fetching
3080+
__PACKAGES='wget'
3081+
3082+
# Required as it is not installed by default on Debian 9+
30553083
if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then
3056-
__PACKAGES="${__PACKAGES} gnupg2 dirmngr"
3057-
else
3058-
__PACKAGES="${__PACKAGES} gnupg-curl"
3084+
__PACKAGES="${__PACKAGES} gnupg2"
30593085
fi
30603086

30613087
# Make sure https transport is available
@@ -3375,14 +3401,8 @@ install_debian_git_post() {
33753401
# Install initscripts for Debian 7 "Wheezy"
33763402
elif [ ! -f "/etc/init.d/salt-$fname" ] || \
33773403
{ [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then
3378-
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-$fname.init" ]; then
3379-
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init" "/etc/init.d/salt-${fname}"
3380-
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.environment" "/etc/default/salt-${fname}"
3381-
else
3382-
# Make sure wget is available
3383-
__check_command_exists wget || __apt_get_install_noinput wget || return 1
3384-
__fetch_url "/etc/init.d/salt-${fname}" "${HTTP_VAL}://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init"
3385-
fi
3404+
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}"
3405+
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}"
33863406

33873407
if [ ! -f "/etc/init.d/salt-${fname}" ]; then
33883408
echowarn "The init script for salt-${fname} was not found, skipping it..."
@@ -6611,6 +6631,117 @@ daemons_running_voidlinux() {
66116631
#
66126632
#######################################################################################################################
66136633

6634+
#######################################################################################################################
6635+
#
6636+
# OS X / Darwin Install Functions
6637+
#
6638+
6639+
__macosx_get_packagesite() {
6640+
DARWIN_ARCH="x86_64"
6641+
6642+
__PY_VERSION_REPO="py2"
6643+
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
6644+
__PY_VERSION_REPO="py3"
6645+
fi
6646+
6647+
PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg"
6648+
SALTPKGCONFURL="https://repo.saltstack.com/osx/${PKG}"
6649+
}
6650+
6651+
# Using a separate conf step to head for idempotent install...
6652+
__configure_macosx_pkg_details() {
6653+
__macosx_get_packagesite || return 1
6654+
return 0
6655+
}
6656+
6657+
install_macosx_stable_deps() {
6658+
__configure_macosx_pkg_details || return 1
6659+
return 0
6660+
}
6661+
6662+
install_macosx_git_deps() {
6663+
install_macosx_stable_deps || return 1
6664+
6665+
__fetch_url "/tmp/get-pip.py" "https://bootstrap.pypa.io/get-pip.py" || return 1
6666+
6667+
if [ -n "$_PY_EXE" ]; then
6668+
_PYEXE=${_PY_EXE}
6669+
else
6670+
_PYEXE=python2.7
6671+
fi
6672+
6673+
# Install PIP
6674+
$_PYEXE /tmp/get-pip.py || return 1
6675+
6676+
__git_clone_and_checkout || return 1
6677+
6678+
__PIP_REQUIREMENTS="dev_python27.txt"
6679+
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
6680+
__PIP_REQUIREMENTS="dev_python34.txt"
6681+
fi
6682+
6683+
requirements_file="${_SALT_GIT_CHECKOUT_DIR}/requirements/${__PIP_REQUIREMENTS}"
6684+
pip install -U -r "${requirements_file}" --install-option="--prefix=/opt/salt" || return 1
6685+
6686+
return 0
6687+
}
6688+
6689+
install_macosx_stable() {
6690+
install_macosx_stable_deps || return 1
6691+
6692+
/usr/bin/curl "${SALTPKGCONFURL}" > "/tmp/${PKG}" || return 1
6693+
6694+
/usr/sbin/installer -pkg "/tmp/${PKG}" -target / || return 1
6695+
6696+
return 0
6697+
}
6698+
6699+
install_macosx_git() {
6700+
6701+
if [ -n "$_PY_EXE" ]; then
6702+
_PYEXE=${_PY_EXE}
6703+
else
6704+
_PYEXE=python2.7
6705+
fi
6706+
6707+
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
6708+
$_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/opt/salt || return 1
6709+
else
6710+
$_PYEXE setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/opt/salt || return 1
6711+
fi
6712+
6713+
return 0
6714+
}
6715+
6716+
install_macosx_stable_post() {
6717+
if [ ! -f /etc/paths.d/salt ]; then
6718+
print "%s\n" "/opt/salt/bin" "/usr/local/sbin" > /etc/paths.d/salt
6719+
fi
6720+
6721+
# shellcheck disable=SC1091
6722+
. /etc/profile
6723+
6724+
return 0
6725+
}
6726+
6727+
install_macosx_git_post() {
6728+
install_macosx_stable_post || return 1
6729+
return 0
6730+
}
6731+
6732+
install_macosx_restart_daemons() {
6733+
[ $_START_DAEMONS -eq $BS_FALSE ] && return
6734+
6735+
/bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1
6736+
/bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1
6737+
6738+
return 0
6739+
}
6740+
#
6741+
# Ended OS X / Darwin Install Functions
6742+
#
6743+
#######################################################################################################################
6744+
66146745
#######################################################################################################################
66156746
#
66166747
# Default minion configuration function. Matches ANY distribution as long as

0 commit comments

Comments
 (0)