Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
s0undt3ch committed Oct 3, 2019
2 parents 13b8215 + a602a86 commit 2bdcfa3
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 32 deletions.
16 changes: 10 additions & 6 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ Brandon Clifford brandon099 [email protected]
Bret Fisher BretFisher [email protected]
Brian Kruger bkruger99 [email protected]
bruce-one bruce-one
Вячеслав Спиридонов sp1r
Bryce Larson bryceml
C. R. Oldham cro [email protected]
Cam camereonsparr
Charles McLaughlin cmclaughlin
Megan Wilhite Ch3LL [email protected]
Chris Rebert cvrebert [email protected]
Chris Buechler cbuechler [email protected]
Chris Rebert cvrebert [email protected]
Christer Edwards cedwards
Christian McHugh mchugh19
Clark Perkins iclarkperkins [email protected]
Expand All @@ -60,22 +59,24 @@ Eric Radman eradman [email protected]
Erik Ankrom erikankrom
Erik Johnson terminalmage [email protected]
EYJ eyj
Felippe Burk felippeb
fizmat fizmat
Forrest Alvarez gravyboat
Fred Reimer freimer [email protected]
Gareth J. Greenaway garethgreenaway [email protected]
gdm85 gdm85
Geoff Garside geoffgarside [email protected]
George aflat [email protected]
gdm85 gdm85
ggillies ggillies
Giuseppe Iannello giannello [email protected]
Gregory Meno GregMeno [email protected]
Guillaume Derval GuillaumeDerval [email protected]
gweis gweis
Henrik Holmboe holmboe
Howard Mei HowardMei [email protected]
Jan Heidbrink jheidbrink
James Booth absolutejam [email protected]
Jan Heidbrink jheidbrink
Jared Bristow jars99
Jared E Stroud jaredestroud [email protected]
Jasper Lievisse Adriaanse jasperla [email protected]
JD decomposite
Expand All @@ -89,8 +90,8 @@ Karl Grzeszczak karlgrz
Kenneth Wilke KennethWilke
Kevin Quinn kevinquinnyo [email protected]
Ky-Anh Huynh icy
lomeroe lomeroe
Liu Xiaohui oreh [email protected]
lomeroe lomeroe
Lorenzo Perone lopezio [email protected]
Lubomir Host lhost
luthes luthes [email protected]
Expand All @@ -106,6 +107,7 @@ Matthew Mead-Briggs mattmb
Matthew Richardson mrichar1
Matthew Willson ixela
Matthieu Guegan mguegan
Megan Wilhite Ch3LL [email protected]
mfapouw mfapouw
Michael A. Smith kojiromike [email protected]
Michael Scherer mscherer
Expand Down Expand Up @@ -164,4 +166,6 @@ Wout wfhg
Yann Masson ymasson
Yoan Blanc greut [email protected]
Yushi Nakai nyushi
Zahiar Ahmed zahiar
Вячеслав Спиридонов sp1r
========================== ===================== ============================
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Version TBD (In Progress on the Develop Branch):

Version 2019.10.03:
* Fix possible typo with `gnupg-curl` vs `gnupg curl` (zahiar)
* Install only python3 packges if requested on ubuntu (noelmcloughlin) #1356
* Fixing debian wheezy (bryceml) #1359
* Fixed Amazon Linux 2 detection when lsb_release is installed (jars99) #1361
* Mac OS Support (felippeb) #1363 #1364 #1365 #1366

Version 2019.05.20:
* Allow stable version selection for amazon linux (puluanau) #1328
* FreeBSD 12 support (sticky-note) #1329
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ sum** of the downloaded ``bootstrap-salt.sh`` file.

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

- 2019.05.20: ``46fb5e4b7815efafd69fd703f033fe86e7b584b6770f7e0b936995bcae1cedd8``
- 2019.02.27: ``23728e4b5e54f564062070e3be53c5602b55c24c9a76671968abbf3d609258cb``
- 2019.01.08: ``ab7f29b75711da4bb79aff98d46654f910d569ebe3e908753a3c5119017bb163``
- 2018.08.15: ``6d414a39439a7335af1b78203f9d37e11c972b3c49c519742c6405e2944c6c4b``
Expand Down
183 changes: 157 additions & 26 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#======================================================================================================================
set -o nounset # Treat unset variables as an error

__ScriptVersion="2019.05.20"
__ScriptVersion="2019.10.03"
__ScriptName="bootstrap-salt.sh"

__ScriptFullName="$0"
Expand Down Expand Up @@ -601,7 +601,11 @@ elif [ "$ITYPE" = "stable" ]; then
STABLE_REV="$1"
shift
elif [ "$(echo "$1" | grep -E '^([0-9]*\.[0-9]*\.[0-9]*)$')" != "" ]; then
STABLE_REV="archive/$1"
if [ "$(uname)" = "Darwin" ]; then
STABLE_REV="$1"
else
STABLE_REV="archive/$1"
fi
shift
else
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)"
Expand Down Expand Up @@ -667,7 +671,11 @@ fi

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

_PY_MAJOR_VERSION=$(echo "$_PY_PKG_VER" | cut -c 7)
if [ "$_PY_MAJOR_VERSION" != 3 ] && [ "$_PY_MAJOR_VERSION" != 2 ]; then
Expand Down Expand Up @@ -1001,7 +1009,7 @@ __gather_linux_system_info() {
elif [ "${DISTRO_NAME}" = "OracleServer" ]; then
# This the Oracle Linux Server 6.5
DISTRO_NAME="Oracle Linux"
elif [ "${DISTRO_NAME}" = "AmazonAMI" ]; then
elif [ "${DISTRO_NAME}" = "AmazonAMI" ] || [ "${DISTRO_NAME}" = "Amazon" ]; then
DISTRO_NAME="Amazon Linux AMI"
elif [ "${DISTRO_NAME}" = "ManjaroLinux" ]; then
DISTRO_NAME="Arch Linux"
Expand Down Expand Up @@ -1243,6 +1251,16 @@ __gather_bsd_system_info() {
}


#--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: __gather_osx_system_info
# DESCRIPTION: Discover MacOS X
#----------------------------------------------------------------------------------------------------------------------
__gather_osx_system_info() {
DISTRO_NAME="MacOSX"
DISTRO_VERSION=$(sw_vers -productVersion)
}


#--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: __gather_system_info
# DESCRIPTION: Discover which system and distribution we are running.
Expand All @@ -1258,6 +1276,9 @@ __gather_system_info() {
openbsd|freebsd|netbsd )
__gather_bsd_system_info
;;
darwin )
__gather_osx_system_info
;;
* )
echoerror "${OS_NAME} not supported.";
exit 1
Expand Down Expand Up @@ -1448,6 +1469,7 @@ __debian_derivatives_translation() {
linuxmint_1_debian_base="8.0"
raspbian_8_debian_base="8.0"
raspbian_9_debian_base="9.0"
raspbian_10_debian_base="10.0"
bunsenlabs_9_debian_base="9.0"
turnkey_9_debian_base="9.0"

Expand Down Expand Up @@ -2648,13 +2670,12 @@ __install_saltstack_ubuntu_repository() {
UBUNTU_CODENAME=${DISTRO_CODENAME}
fi

__PACKAGES=''

# Install downloader backend for GPG keys fetching
if [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then
__PACKAGES="${__PACKAGES} gnupg dirmngr"
else
__PACKAGES="${__PACKAGES} gnupg-curl"
__PACKAGES='wget'

# Required as it is not installed by default on Ubuntu 18+
if [ "$DISTRO_MAJOR_VERSION" -ge 18 ]; then
__PACKAGES="${__PACKAGES} gnupg"
fi

# Make sure https transport is available
Expand Down Expand Up @@ -2698,6 +2719,12 @@ install_ubuntu_deps() {
__PACKAGES="upstart"
fi

if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
PY_PKG_VER=3
else
PY_PKG_VER=""
fi

if [ "$DISTRO_MAJOR_VERSION" -ge 16 ] && [ -z "$_PY_EXE" ]; then
__PACKAGES="${__PACKAGES} python2.7"
fi
Expand All @@ -2706,13 +2733,13 @@ install_ubuntu_deps() {
__PACKAGES="${__PACKAGES} python-virtualenv"
fi
# Need python-apt for managing packages via Salt
__PACKAGES="${__PACKAGES} python-apt"
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-apt"

# requests is still used by many salt modules
__PACKAGES="${__PACKAGES} python-requests"
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-requests"

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

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

__PACKAGES=''

# Install downloader backend for GPG keys fetching
__PACKAGES='wget'

# Required as it is not installed by default on Debian 9+
if [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then
__PACKAGES="${__PACKAGES} gnupg2 dirmngr"
else
__PACKAGES="${__PACKAGES} gnupg-curl"
__PACKAGES="${__PACKAGES} gnupg2"
fi

# Make sure https transport is available
Expand Down Expand Up @@ -3375,14 +3401,8 @@ install_debian_git_post() {
# Install initscripts for Debian 7 "Wheezy"
elif [ ! -f "/etc/init.d/salt-$fname" ] || \
{ [ -f "/etc/init.d/salt-$fname" ] && [ "$_FORCE_OVERWRITE" -eq $BS_TRUE ]; }; then
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-$fname.init" ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.init" "/etc/init.d/salt-${fname}"
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.environment" "/etc/default/salt-${fname}"
else
# Make sure wget is available
__check_command_exists wget || __apt_get_install_noinput wget || return 1
__fetch_url "/etc/init.d/salt-${fname}" "${HTTP_VAL}://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init"
fi
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.init" "/etc/init.d/salt-${fname}"
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.environment" "/etc/default/salt-${fname}"

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

#######################################################################################################################
#
# OS X / Darwin Install Functions
#

__macosx_get_packagesite() {
DARWIN_ARCH="x86_64"

__PY_VERSION_REPO="py2"
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
__PY_VERSION_REPO="py3"
fi

PKG="salt-${STABLE_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}.pkg"
SALTPKGCONFURL="https://repo.saltstack.com/osx/${PKG}"
}

# Using a separate conf step to head for idempotent install...
__configure_macosx_pkg_details() {
__macosx_get_packagesite || return 1
return 0
}

install_macosx_stable_deps() {
__configure_macosx_pkg_details || return 1
return 0
}

install_macosx_git_deps() {
install_macosx_stable_deps || return 1

__fetch_url "/tmp/get-pip.py" "https://bootstrap.pypa.io/get-pip.py" || return 1

if [ -n "$_PY_EXE" ]; then
_PYEXE=${_PY_EXE}
else
_PYEXE=python2.7
fi

# Install PIP
$_PYEXE /tmp/get-pip.py || return 1

__git_clone_and_checkout || return 1

__PIP_REQUIREMENTS="dev_python27.txt"
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
__PIP_REQUIREMENTS="dev_python34.txt"
fi

requirements_file="${_SALT_GIT_CHECKOUT_DIR}/requirements/${__PIP_REQUIREMENTS}"
pip install -U -r "${requirements_file}" --install-option="--prefix=/opt/salt" || return 1

return 0
}

install_macosx_stable() {
install_macosx_stable_deps || return 1

/usr/bin/curl "${SALTPKGCONFURL}" > "/tmp/${PKG}" || return 1

/usr/sbin/installer -pkg "/tmp/${PKG}" -target / || return 1

return 0
}

install_macosx_git() {

if [ -n "$_PY_EXE" ]; then
_PYEXE=${_PY_EXE}
else
_PYEXE=python2.7
fi

if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
$_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
else
$_PYEXE setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/opt/salt || return 1
fi

return 0
}

install_macosx_stable_post() {
if [ ! -f /etc/paths.d/salt ]; then
print "%s\n" "/opt/salt/bin" "/usr/local/sbin" > /etc/paths.d/salt
fi

# shellcheck disable=SC1091
. /etc/profile

return 0
}

install_macosx_git_post() {
install_macosx_stable_post || return 1
return 0
}

install_macosx_restart_daemons() {
[ $_START_DAEMONS -eq $BS_FALSE ] && return

/bin/launchctl unload -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1
/bin/launchctl load -w /Library/LaunchDaemons/com.saltstack.salt.minion.plist || return 1

return 0
}
#
# Ended OS X / Darwin Install Functions
#
#######################################################################################################################

#######################################################################################################################
#
# Default minion configuration function. Matches ANY distribution as long as
Expand Down

0 comments on commit 2bdcfa3

Please sign in to comment.