Merge pull request #1013 from rallytime/merge-stable

[stable] Merge develop into stable
This commit is contained in:
Nicole Thomas 2017-01-10 14:51:41 -07:00 committed by GitHub
commit b2d6b80ec1
4 changed files with 315 additions and 187 deletions

View file

@ -12,6 +12,7 @@ Adam Wright hipikat adam@hipikat.org
Alec Koumjian akoumjian akoumjian@gmail.com Alec Koumjian akoumjian akoumjian@gmail.com
Alex Van't Hof alexvh Alex Van't Hof alexvh
Alexander Krasnukhin themalkolm the.malkolm@gmail.com Alexander Krasnukhin themalkolm the.malkolm@gmail.com
Alexey dmitrievav
Angelo Gründler plueschopath angelo.gruendler@w1r3.net Angelo Gründler plueschopath angelo.gruendler@w1r3.net
Ari Aosved devaos ari.aosved@gmail.com Ari Aosved devaos ari.aosved@gmail.com
Beau Hargis beaucephus beau@customermobile.com Beau Hargis beaucephus beau@customermobile.com
@ -35,6 +36,7 @@ denmat denmat
Denys Havrysh vutny denys.gavrysh@gmail.com Denys Havrysh vutny denys.gavrysh@gmail.com
deployboy deployboy deployboy deployboy
Diego Woitasen diegows diego@flugel.it Diego Woitasen diegows diego@flugel.it
ek9 ek9
Elias Probst eliasp Elias Probst eliasp
eliezerlp eliezerlp eliezerlp eliezerlp
Emiel Kollof ekollof Emiel Kollof ekollof
@ -66,8 +68,9 @@ lomeroe lomeroe
Liu Xiaohui oreh herolxh@gmail.com Liu Xiaohui oreh herolxh@gmail.com
Lubomir Host lhost Lubomir Host lhost
Marc Vieira-Cardinal marccadinal Marc Vieira-Cardinal marccadinal
Mark Lee malept Marco Molteni marco-m
Marcus Furlong furlongm furlongm@gmail.com Marcus Furlong furlongm furlongm@gmail.com
Mark Lee malept
markgaylard markgaylard markgaylard markgaylard
Matt Black mafrosis Matt Black mafrosis
Matthew Garrett cingeyedog matt@clemson.edu Matthew Garrett cingeyedog matt@clemson.edu

View file

@ -1,3 +1,23 @@
Version 2017.01.10:
* Update AUTHORS.rst with new contributors (rallytime) #1011
* fix bootstrap in Arch Linux by updating package name from salt-zmq to salt (ek9) #1007
* Add python-systemd package to debian 8 git install (rallytime) #1003
* Updated supported versions for Ubuntu: 12.04, 14.04, 16.04, and 16.10 (best effort) (rallytime) #1002
* Add "yakkety" to ubuntu_codename_translation function (rallytime) #1001
* Update supported versions for Fedora: 23, 24, and 25. (rallytime) #1000
* Handle renaming of gnupg-curl to gnupg1-curl for Ubuntu 16.10 (marco-m) #998
* fix systemctl path (dmitrievav) #997
* Drop unnecessary workarounds (creating directories) for early releases (vutny) #995
* Let's detect newly released Salt 2016.11 stable release (vutny) #994
* Adjust code examples to use the actual bootstrap-salt.sh file name (rallytime) #993
* Install TLS certs before cloning git repo via https (vutny) #991
* Remove fix me comment and fix systemsmanagement link (rallytime) #990
* Correct usage description about "config only" mode (vutny) #989
* Fix overwriting Minion config from temporarily directory (vutny) #988
* Configure Salt components after the dependencies installation (vutny) #987
* Add CloudLinux support (rallytime) #986
* Apply the insecure flag to git as well (cachedout) #981
Version 2016.10.25: Version 2016.10.25:
* Update AUTHORS.rst with new contributors (rallytime) #978 * Update AUTHORS.rst with new contributors (rallytime) #978
* Let's start detecting the upcoming Debian 9 (Stretch) (lhost) #975 * Let's start detecting the upcoming Debian 9 (Stretch) (lhost) #975

View file

@ -58,37 +58,37 @@ Using ``curl`` to install latest development version from GitHub:
.. code:: console .. code:: console
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh git develop sudo sh bootstrap-salt.sh git develop
If you want to install a specific release version (based on the Git tags): If you want to install a specific release version (based on the Git tags):
.. code:: console .. code:: console
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh git v2016.3.2 sudo sh bootstrap-salt.sh git v2016.3.2
To install a specific branch from a Git fork: To install a specific branch from a Git fork:
.. code:: console .. code:: console
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh -g https://github.com/myuser/salt.git git mybranch sudo sh bootstrap-salt.sh -g https://github.com/myuser/salt.git git mybranch
If all you want is to install a ``salt-master`` using latest Git: If all you want is to install a ``salt-master`` using latest Git:
.. code:: console .. code:: console
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh -M -N git develop sudo sh bootstrap-salt.sh -M -N git develop
If your host has Internet access only via HTTP proxy: If your host has Internet access only via HTTP proxy:
.. code:: console .. code:: console
PROXY='http://user:password@myproxy.example.com:3128' PROXY='http://user:password@myproxy.example.com:3128'
curl -o bootstrap_salt.sh -L -x "$PROXY" https://bootstrap.saltstack.com curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh -H "$PROXY" git sudo sh bootstrap-salt.sh -H "$PROXY" git
Install using wget Install using wget
@ -98,15 +98,15 @@ Using ``wget`` to install your distribution's stable packages:
.. code:: console .. code:: console
wget -O bootstrap_salt.sh https://bootstrap.saltstack.com wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh sudo sh bootstrap-salt.sh
Installing a specific version from git using ``wget``: Installing a specific version from git using ``wget``:
.. code:: console .. code:: console
wget -O bootstrap_salt.sh https://bootstrap.saltstack.com wget -O bootstrap-salt.sh https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh -P git v2015.8.11 sudo sh bootstrap-salt.sh -P git v2015.8.11
.. note:: .. note::
@ -121,15 +121,15 @@ If you already have Python installed, ``python 2.6``, then it's as easy as:
.. code:: console .. code:: console
python -m urllib "https://bootstrap.saltstack.com" > bootstrap_salt.sh python -m urllib "https://bootstrap.saltstack.com" > bootstrap-salt.sh
sudo sh bootstrap_salt.sh git develop sudo sh bootstrap-salt.sh git develop
All Python versions should support the following in-line code: All Python versions should support the following in-line code:
.. code:: console .. code:: console
python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > bootstrap_salt.sh python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > bootstrap-salt.sh
sudo sh bootstrap_salt.sh git develop sudo sh bootstrap-salt.sh git develop
Install using fetch Install using fetch
@ -140,8 +140,8 @@ have ``fetch`` available though:
.. code:: console .. code:: console
fetch -o bootstrap_salt.sh https://bootstrap.saltstack.com fetch -o bootstrap-salt.sh https://bootstrap.saltstack.com
sudo sh bootstrap_salt.sh sudo sh bootstrap-salt.sh
If you have any SSL issues install ``ca_root_nssp``: If you have any SSL issues install ``ca_root_nssp``:
@ -200,7 +200,7 @@ Supported Operating Systems
.. note:: .. note::
Bootstrap may fail to install Salt on the cutting-edge version of distributions with frequent Bootstrap may fail to install Salt on the cutting-edge version of distributions with frequent
release cycle, such as: Amazon Linux, Fedora, openSUSE Tumbleweed or Ubuntu non-LTS. Check the release cycles such as: Amazon Linux, Fedora, openSUSE Tumbleweed, or Ubuntu non-LTS. Check the
versions from the list below. Also, see the `Unsupported Distro`_ and versions from the list below. Also, see the `Unsupported Distro`_ and
`Adding Support for Other Operating Systems`_ sections. `Adding Support for Other Operating Systems`_ sections.
@ -216,8 +216,8 @@ Debian and derivatives
.. note:: .. note::
Installation of Salt packages on Debian 8 based distribution from repo.saltstack.com repository Installation of Salt packages on Debian 8 based distribution from repo.saltstack.com repository
is currently supported for ``amd64`` (``x86-64``) and ``armhf`` architechtures ONLY. Use ``git`` is currently supported for ``amd64`` (``x86-64``) and ``armhf`` architectures ONLY. Use ``git``
bootstrap mode as described above to install Salt on other architechtures, such as ``i386`` or bootstrap mode as described above to install Salt on other architectures, such as ``i386`` or
``armel``. You also may need to disable repository configuration and allow ``pip`` installations ``armel``. You also may need to disable repository configuration and allow ``pip`` installations
by providing ``-r`` and ``-P`` options to the bootstrap script, i.e.: by providing ``-r`` and ``-P`` options to the bootstrap script, i.e.:
@ -231,7 +231,7 @@ Red Hat family
- Amazon Linux 2012.09/2013.03/2013.09/2014.03/2014.09 - Amazon Linux 2012.09/2013.03/2013.09/2014.03/2014.09
- CentOS 5/6/7 - CentOS 5/6/7
- Fedora 17/18/20/21/22 - Fedora 23/24/25
- Oracle Linux 5/6/7 - Oracle Linux 5/6/7
- Red Hat Enterprise Linux 5/6/7 - Red Hat Enterprise Linux 5/6/7
- Scientific Linux 5/6/7 - Scientific Linux 5/6/7
@ -251,9 +251,22 @@ Ubuntu and derivatives
- Elementary OS 0.2 (based on Ubuntu 12.04) - Elementary OS 0.2 (based on Ubuntu 12.04)
- Linaro 12.04 - Linaro 12.04
- Linux Mint 13/14/16/17/18 - Linux Mint 13/17/18
- Trisquel GNU/Linux 6 (based on Ubuntu 12.04) - Trisquel GNU/Linux 6 (based on Ubuntu 12.04)
- Ubuntu 10.x/11.x/12.x/13.x/14.x/15.x/16.04 - Ubuntu 12.04/14.04/16.04
Ubuntu Best Effort Support: Non-LTS Releases
********************************************
This script provides best-effort support for current, non-LTS Ubuntu releases. If package
repositories are not provided on `SaltStack's Ubuntu repository`_ for the non-LTS release, the
bootstrap script will attempt to install the packages for the most closely related LTS Ubuntu
release instead.
For example, when installing Salt on Ubuntu 16.10, the bootstrap script will setup the repository
for Ubuntu 16.04 from `SaltStack's Ubuntu repository`_ and install the 16.04 packages.
.. _`SaltStack's Ubuntu repository`: http://repo.saltstack.com/#ubuntu
Other Linux distro Other Linux distro
@ -479,8 +492,8 @@ version.
.. code:: console .. code:: console
curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com/develop curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com/develop
sudo sh bootstrap_salt.sh git develop sudo sh bootstrap-salt.sh git develop
Or the insecure one liner: Or the insecure one liner:

View file

@ -9,7 +9,7 @@
# #
# BUGS: https://github.com/saltstack/salt-bootstrap/issues # BUGS: https://github.com/saltstack/salt-bootstrap/issues
# #
# COPYRIGHT: (c) 2012-2016 by the SaltStack Team, see AUTHORS.rst for more # COPYRIGHT: (c) 2012-2017 by the SaltStack Team, see AUTHORS.rst for more
# details. # details.
# #
# LICENSE: Apache 2.0 # LICENSE: Apache 2.0
@ -18,7 +18,7 @@
#====================================================================================================================== #======================================================================================================================
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
__ScriptVersion="2016.10.25" __ScriptVersion="2017.01.10"
__ScriptName="bootstrap-salt.sh" __ScriptName="bootstrap-salt.sh"
__ScriptFullName="$0" __ScriptFullName="$0"
@ -309,9 +309,10 @@ __usage() {
-F Allow copied files to overwrite existing (config, init.d, etc) -F Allow copied files to overwrite existing (config, init.d, etc)
-K If set, keep the temporary files in the temporary directories specified -K If set, keep the temporary files in the temporary directories specified
with -c and -k with -c and -k
-C Only run the configuration function. This option automatically bypasses -C Only run the configuration function. Implies -F (forced overwrite).
any installation. Implies -F (forced overwrite). To overwrite master or To overwrite Master or Syndic configs, -M or -S, respectively, must
syndic configs, -M or -S, respectively, must also be specified. also be specified. Salt installation will be ommitted, but some of the
dependencies could be installed to write configuration with -j or -J.
-A Pass the salt-master DNS name or IP. This will be stored under -A Pass the salt-master DNS name or IP. This will be stored under
\${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf \${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf
-i Pass the salt-minion id. This will be stored under -i Pass the salt-minion id. This will be stored under
@ -342,12 +343,12 @@ __usage() {
repo.saltstack.com. The option passed with -R replaces the repo.saltstack.com. The option passed with -R replaces the
"repo.saltstack.com". If -R is passed, -r is also set. Currently only "repo.saltstack.com". If -R is passed, -r is also set. Currently only
works on CentOS/RHEL based distributions. works on CentOS/RHEL based distributions.
-J Replace the Master config file with data passed in as a json string. If -J Replace the Master config file with data passed in as a JSON string. If
a Master config file is found, a reasonable effort will be made to save a Master config file is found, a reasonable effort will be made to save
the file with a ".bak" extension. If used in conjunction with -C or -F, the file with a ".bak" extension. If used in conjunction with -C or -F,
no ".bak" file will be created as either of those options will force no ".bak" file will be created as either of those options will force
a complete overwrite of the file. a complete overwrite of the file.
-j Replace the Minion config file with data passed in as a json string. If -j Replace the Minion config file with data passed in as a JSON string. If
a Minion config file is found, a reasonable effort will be made to save a Minion config file is found, a reasonable effort will be made to save
the file with a ".bak" extension. If used in conjunction with -C or -F, the file with a ".bak" extension. If used in conjunction with -C or -F,
no ".bak" file will be created as either of those options will force no ".bak" file will be created as either of those options will force
@ -475,7 +476,7 @@ fi
# Check that we're installing or configuring a master if we're being passed a master config json dict # Check that we're installing or configuring a master if we're being passed a master config json dict
if [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then if [ "$_CUSTOM_MASTER_CONFIG" != "null" ]; then
if [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then if [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then
echoerror "Don't pass a master config json dict (-J) if no master is going to be bootstrapped or configured." echoerror "Don't pass a master config JSON dict (-J) if no master is going to be bootstrapped or configured."
exit 1 exit 1
fi fi
fi fi
@ -483,7 +484,7 @@ fi
# Check that we're installing or configuring a minion if we're being passed a minion config json dict # Check that we're installing or configuring a minion if we're being passed a minion config json dict
if [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then if [ "$_CUSTOM_MINION_CONFIG" != "null" ]; then
if [ "$_INSTALL_MINION" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then if [ "$_INSTALL_MINION" -eq $BS_FALSE ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then
echoerror "Don't pass a minion config json dict (-j) if no minion is going to be bootstrapped or configured." echoerror "Don't pass a minion config JSON dict (-j) if no minion is going to be bootstrapped or configured."
exit 1 exit 1
fi fi
fi fi
@ -850,7 +851,7 @@ __derive_debian_numeric_version() {
# DESCRIPTION: Strip single or double quotes from the provided string. # DESCRIPTION: Strip single or double quotes from the provided string.
#---------------------------------------------------------------------------------------------------------------------- #----------------------------------------------------------------------------------------------------------------------
__unquote_string() { __unquote_string() {
echo "$*" | sed -e "s/^\([\"']\)\(.*\)\1\$/\2/g" echo "$*" | sed -e "s/^\([\"\']\)\(.*\)\1\$/\2/g"
} }
#--- FUNCTION ------------------------------------------------------------------------------------------------------- #--- FUNCTION -------------------------------------------------------------------------------------------------------
@ -924,6 +925,8 @@ __gather_linux_system_info() {
DISTRO_NAME=$(lsb_release -si) DISTRO_NAME=$(lsb_release -si)
if [ "${DISTRO_NAME}" = "Scientific" ]; then if [ "${DISTRO_NAME}" = "Scientific" ]; then
DISTRO_NAME="Scientific Linux" DISTRO_NAME="Scientific Linux"
elif [ "$(echo "$DISTRO_NAME" | grep ^CloudLinux)" != "" ]; then
DISTRO_NAME="Cloud Linux"
elif [ "$(echo "$DISTRO_NAME" | grep ^RedHat)" != "" ]; then elif [ "$(echo "$DISTRO_NAME" | grep ^RedHat)" != "" ]; then
# Let's convert 'CamelCased' to 'Camel Cased' # Let's convert 'CamelCased' to 'Camel Cased'
n=$(__camelcase_split "$DISTRO_NAME") n=$(__camelcase_split "$DISTRO_NAME")
@ -1037,6 +1040,9 @@ __gather_linux_system_info() {
n="Arch Linux" n="Arch Linux"
v="" # Arch Linux does not provide a version. v="" # Arch Linux does not provide a version.
;; ;;
cloudlinux )
n="Cloud Linux"
;;
debian ) debian )
n="Debian" n="Debian"
v=$(__derive_debian_numeric_version "$v") v=$(__derive_debian_numeric_version "$v")
@ -1195,12 +1201,6 @@ __ubuntu_derivatives_translation() {
# Mappings # Mappings
trisquel_6_ubuntu_base="12.04" trisquel_6_ubuntu_base="12.04"
linuxmint_13_ubuntu_base="12.04" linuxmint_13_ubuntu_base="12.04"
linuxmint_14_ubuntu_base="12.10"
#linuxmint_15_ubuntu_base="13.04"
# Bug preventing add-apt-repository from working on Mint 15:
# https://bugs.launchpad.net/linuxmint/+bug/1198751
linuxmint_16_ubuntu_base="13.10"
linuxmint_17_ubuntu_base="14.04" linuxmint_17_ubuntu_base="14.04"
linuxmint_18_ubuntu_base="16.04" linuxmint_18_ubuntu_base="16.04"
linaro_12_ubuntu_base="12.04" linaro_12_ubuntu_base="12.04"
@ -1258,15 +1258,12 @@ __ubuntu_codename_translation() {
"14") "14")
DISTRO_CODENAME="trusty" DISTRO_CODENAME="trusty"
;; ;;
"15")
if [ -n "$_april" ]; then
DISTRO_CODENAME="vivid"
else
DISTRO_CODENAME="wily"
fi
;;
"16") "16")
DISTRO_CODENAME="xenial" if [ "$_april" ]; then
DISTRO_CODENAME="xenial"
else
DISTRO_CODENAME="yakkety"
fi
;; ;;
*) *)
DISTRO_CODENAME="trusty" DISTRO_CODENAME="trusty"
@ -1453,6 +1450,14 @@ if ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ $_PIP_ALL -eq $BS_TRUE ]);then
exit 1 exit 1
fi fi
# Starting from Ubuntu 16.10, gnupg-curl has been renamed to gnupg1-curl.
GNUPG_CURL="gnupg-curl"
if ([ "${DISTRO_NAME_L}" = "ubuntu" ] && [ "${DISTRO_VERSION}" = "16.10" ]); then
GNUPG_CURL="gnupg1-curl"
fi
#--- FUNCTION ------------------------------------------------------------------------------------------------------- #--- FUNCTION -------------------------------------------------------------------------------------------------------
# NAME: __function_defined # NAME: __function_defined
# DESCRIPTION: Checks if a function is defined within this scripts scope # DESCRIPTION: Checks if a function is defined within this scripts scope
@ -1497,7 +1502,7 @@ __apt_get_upgrade_noinput() {
__apt_key_fetch() { __apt_key_fetch() {
url=$1 url=$1
__apt_get_install_noinput gnupg-curl || return 1 __apt_get_install_noinput ${GNUPG_CURL} || return 1
# shellcheck disable=SC2086 # shellcheck disable=SC2086
apt-key adv ${_GPG_ARGS} --fetch-keys "$url"; return $? apt-key adv ${_GPG_ARGS} --fetch-keys "$url"; return $?
@ -1561,6 +1566,10 @@ __yum_install_noinput() {
__git_clone_and_checkout() { __git_clone_and_checkout() {
echodebug "Installed git version: $(git --version | awk '{ print $3 }')" echodebug "Installed git version: $(git --version | awk '{ print $3 }')"
# Turn off SSL verification if -I flag was set for insecure downloads
if [ "$_INSECURE_DL" -eq $BS_TRUE ]; then
export GIT_SSL_NO_VERIFY=1
fi
__SALT_GIT_CHECKOUT_PARENT_DIR=$(dirname "${_SALT_GIT_CHECKOUT_DIR}" 2>/dev/null) __SALT_GIT_CHECKOUT_PARENT_DIR=$(dirname "${_SALT_GIT_CHECKOUT_DIR}" 2>/dev/null)
__SALT_GIT_CHECKOUT_PARENT_DIR="${__SALT_GIT_CHECKOUT_PARENT_DIR:-/tmp/git}" __SALT_GIT_CHECKOUT_PARENT_DIR="${__SALT_GIT_CHECKOUT_PARENT_DIR:-/tmp/git}"
@ -1689,7 +1698,12 @@ __check_end_of_life_versions() {
# Ubuntu versions not supported # Ubuntu versions not supported
# #
# < 12.04 # < 12.04
if [ "$DISTRO_MAJOR_VERSION" -lt 12 ]; then # 13.x, 15.x
# 12.10, 14.10
if [ "$DISTRO_MAJOR_VERSION" -lt 12 ] || \
[ "$DISTRO_MAJOR_VERSION" -eq 13 ] || \
[ "$DISTRO_MAJOR_VERSION" -eq 15 ] || \
([ "$DISTRO_MAJOR_VERSION" -lt 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then
echoerror "End of life distributions are not supported." echoerror "End of life distributions are not supported."
echoerror "Please consider upgrading to the next stable. See:" echoerror "Please consider upgrading to the next stable. See:"
echoerror " https://wiki.ubuntu.com/Releases" echoerror " https://wiki.ubuntu.com/Releases"
@ -1726,7 +1740,7 @@ __check_end_of_life_versions() {
fedora) fedora)
# Fedora lower than 18 are no longer supported # Fedora lower than 18 are no longer supported
if [ "$DISTRO_MAJOR_VERSION" -lt 18 ]; then if [ "$DISTRO_MAJOR_VERSION" -lt 23 ]; then
echoerror "End of life distributions are not supported." echoerror "End of life distributions are not supported."
echoerror "Please consider upgrading to the next stable. See:" echoerror "Please consider upgrading to the next stable. See:"
echoerror " https://fedoraproject.org/wiki/Releases" echoerror " https://fedoraproject.org/wiki/Releases"
@ -2284,49 +2298,30 @@ __enable_universe_repository() {
echodebug "Enabling the universe repository" echodebug "Enabling the universe repository"
# Ubuntu versions higher than 12.04 do not live in the old repositories add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1
if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then
add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1
elif [ "$DISTRO_MAJOR_VERSION" -lt 11 ] && [ "$DISTRO_MINOR_VERSION" -lt 10 ]; then
# Below Ubuntu 11.10, the -y flag to add-apt-repository is not supported
add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1
else
add-apt-repository -y "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1
fi
add-apt-repository -y "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1
return 0 return 0
} }
install_ubuntu_deps() { install_ubuntu_deps() {
if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then
# Above Ubuntu 12.04 add-apt-repository is in a different package # Above Ubuntu 12.04 add-apt-repository is in a different package
__apt_get_install_noinput software-properties-common || return 1 __apt_get_install_noinput software-properties-common || return 1
else else
__apt_get_install_noinput python-software-properties || return 1 __apt_get_install_noinput python-software-properties || return 1
fi fi
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
__enable_universe_repository || return 1 __enable_universe_repository || return 1
# Versions starting with 2015.5.6 and 2015.8.1 are hosted at repo.saltstack.com # Versions starting with 2015.5.6 and 2015.8.1 are hosted at repo.saltstack.com
if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|latest|archive\/)')" = "" ]; then if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" = "" ]; then
if [ "$DISTRO_MAJOR_VERSION" -lt 14 ]; then if [ "$DISTRO_MAJOR_VERSION" -lt 14 ]; then
echoinfo "Installing Python Requests/Chardet from Chris Lea's PPA repository" echoinfo "Installing Python Requests/Chardet from Chris Lea's PPA repository"
if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then add-apt-repository -y "ppa:chris-lea/python-requests" || return 1
# Above Ubuntu 11.04 add a -y flag add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1
add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 add-apt-repository -y "ppa:chris-lea/python-urllib3" || return 1
add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1 add-apt-repository -y "ppa:chris-lea/python-crypto" || return 1
add-apt-repository -y "ppa:chris-lea/python-urllib3" || return 1
add-apt-repository -y "ppa:chris-lea/python-crypto" || return 1
else
add-apt-repository "ppa:chris-lea/python-requests" || return 1
add-apt-repository "ppa:chris-lea/python-chardet" || return 1
add-apt-repository "ppa:chris-lea/python-urllib3" || return 1
add-apt-repository "ppa:chris-lea/python-crypto" || return 1
fi
fi fi
fi fi
@ -2337,7 +2332,7 @@ install_ubuntu_deps() {
# Minimal systems might not have upstart installed, install it # Minimal systems might not have upstart installed, install it
__PACKAGES="upstart" __PACKAGES="upstart"
if [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then if [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
__PACKAGES="${__PACKAGES} python2.7" __PACKAGES="${__PACKAGES} python2.7"
fi fi
if [ "$_VIRTUALENV_DIR" != "null" ]; then if [ "$_VIRTUALENV_DIR" != "null" ]; then
@ -2349,6 +2344,9 @@ install_ubuntu_deps() {
# requests is still used by many salt modules # requests is still used by many salt modules
__PACKAGES="${__PACKAGES} python-requests" __PACKAGES="${__PACKAGES} python-requests"
# YAML module is used for generating custom master/minion configs
__PACKAGES="${__PACKAGES} python-yaml"
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
__PACKAGES="${__PACKAGES} procps pciutils" __PACKAGES="${__PACKAGES} procps pciutils"
@ -2365,7 +2363,7 @@ install_ubuntu_deps() {
} }
install_ubuntu_stable_deps() { install_ubuntu_stable_deps() {
if ([ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 15 ]); then if [ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then
# The user did not pass a custom sleep value as an argument, let's increase the default value # The user did not pass a custom sleep value as an argument, let's increase the default value
echodebug "On Ubuntu systems we increase the default sleep value to 10." echodebug "On Ubuntu systems we increase the default sleep value to 10."
echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." echodebug "See https://github.com/saltstack/salt/issues/12248 for more info."
@ -2408,12 +2406,12 @@ install_ubuntu_stable_deps() {
fi fi
# Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com # Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com
if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|latest|archive\/)')" != "" ]; then if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" != "" ]; then
# Workaround for latest non-LTS ubuntu # Workaround for latest non-LTS ubuntu
if [ "$DISTRO_MAJOR_VERSION" -eq 15 ]; then if [ "$DISTRO_VERSION" = "16.10" ]; then
echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems."
UBUNTU_VERSION=14.04 UBUNTU_VERSION=16.04
UBUNTU_CODENAME=trusty UBUNTU_CODENAME=xenial
else else
UBUNTU_VERSION=$DISTRO_VERSION UBUNTU_VERSION=$DISTRO_VERSION
UBUNTU_CODENAME=$DISTRO_CODENAME UBUNTU_CODENAME=$DISTRO_CODENAME
@ -2439,12 +2437,7 @@ install_ubuntu_stable_deps() {
STABLE_PPA="saltstack/salt" STABLE_PPA="saltstack/salt"
fi fi
if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then add-apt-repository -y "ppa:$STABLE_PPA" || return 1
# Above Ubuntu 11.04 add a -y flag
add-apt-repository -y "ppa:$STABLE_PPA" || return 1
else
add-apt-repository "ppa:$STABLE_PPA" || return 1
fi
fi fi
apt-get update apt-get update
@ -2456,24 +2449,17 @@ install_ubuntu_stable_deps() {
install_ubuntu_daily_deps() { install_ubuntu_daily_deps() {
install_ubuntu_stable_deps || return 1 install_ubuntu_stable_deps || return 1
if [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then
# Above Ubuntu 11.10 add-apt-repository is in a different package
__apt_get_install_noinput software-properties-common || return 1 __apt_get_install_noinput software-properties-common || return 1
else else
# Ubuntu 12.04 needs python-software-properties to get add-apt-repository binary
__apt_get_install_noinput python-software-properties || return 1 __apt_get_install_noinput python-software-properties || return 1
fi fi
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
__enable_universe_repository || return 1 __enable_universe_repository || return 1
# for anything up to and including 11.04 do not use the -y option add-apt-repository -y ppa:saltstack/salt-daily || return 1
if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then
# Above Ubuntu 11.04 add a -y flag
add-apt-repository -y ppa:saltstack/salt-daily || return 1
else
add-apt-repository ppa:saltstack/salt-daily || return 1
fi
apt-get update apt-get update
fi fi
@ -2486,7 +2472,15 @@ install_ubuntu_daily_deps() {
install_ubuntu_git_deps() { install_ubuntu_git_deps() {
apt-get update apt-get update
__apt_get_install_noinput git-core || return 1
if ! __check_command_exists git; then
__apt_get_install_noinput git-core || return 1
fi
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
__apt_get_install_noinput ca-certificates
fi
__git_clone_and_checkout || return 1 __git_clone_and_checkout || return 1
__PACKAGES="" __PACKAGES=""
@ -2569,12 +2563,6 @@ install_ubuntu_git() {
} }
install_ubuntu_stable_post() { install_ubuntu_stable_post() {
# Workaround for latest LTS packages on latest ubuntu. Normally packages on
# debian-based systems will automatically start the corresponding daemons
if [ "$DISTRO_MAJOR_VERSION" -lt 15 ]; then
return 0
fi
for fname in api master minion syndic; do for fname in api master minion syndic; do
# Skip salt-api since the service should be opt-in and not necessarily started on boot # Skip salt-api since the service should be opt-in and not necessarily started on boot
[ $fname = "api" ] && continue [ $fname = "api" ] && continue
@ -2607,7 +2595,7 @@ install_ubuntu_git_post() {
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
__copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service"
# Skip salt-api since the service should be opt-in and not necessarily started on boot # Skip salt-api since the service should be opt-in and not necessarily started on boot
@ -2652,7 +2640,7 @@ install_ubuntu_restart_daemons() {
[ $_START_DAEMONS -eq $BS_FALSE ] && return [ $_START_DAEMONS -eq $BS_FALSE ] && return
# Ensure upstart configs / systemd units are loaded # Ensure upstart configs / systemd units are loaded
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
systemctl daemon-reload systemctl daemon-reload
elif [ -f /sbin/initctl ]; then elif [ -f /sbin/initctl ]; then
/sbin/initctl reload-configuration /sbin/initctl reload-configuration
@ -2667,7 +2655,7 @@ install_ubuntu_restart_daemons() {
[ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
echodebug "There's systemd support while checking salt-$fname" echodebug "There's systemd support while checking salt-$fname"
systemctl stop salt-$fname > /dev/null 2>&1 systemctl stop salt-$fname > /dev/null 2>&1
systemctl start salt-$fname.service systemctl start salt-$fname.service
@ -2711,7 +2699,7 @@ install_ubuntu_check_services() {
[ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then
__check_services_systemd salt-$fname || return 1 __check_services_systemd salt-$fname || return 1
elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then
__check_services_upstart salt-$fname || return 1 __check_services_upstart salt-$fname || return 1
@ -2755,6 +2743,9 @@ install_debian_deps() {
__PACKAGES="procps pciutils" __PACKAGES="procps pciutils"
__PIP_PACKAGES="" __PIP_PACKAGES=""
# YAML module is used for generating custom master/minion configs
__PACKAGES="${__PACKAGES} python-yaml"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
__apt_get_install_noinput ${__PACKAGES} || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1
@ -2817,7 +2808,7 @@ install_debian_7_deps() {
fi fi
# Versions starting with 2015.8.7 and 2016.3.0 are hosted at repo.saltstack.com # Versions starting with 2015.8.7 and 2016.3.0 are hosted at repo.saltstack.com
if [ "$(echo "$STABLE_REV" | egrep '^(2015\.8|2016\.3|latest|archive\/201[5-6]\.)')" != "" ]; then if [ "$(echo "$STABLE_REV" | egrep '^(2015\.8|2016\.3|2016\.11|latest|archive\/201[5-6]\.)')" != "" ]; then
# amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location # amd64 is just a part of repository URI, 32-bit pkgs are hosted under the same location
SALTSTACK_DEBIAN_URL="${HTTP_VAL}://repo.saltstack.com/apt/debian/${DISTRO_MAJOR_VERSION}/${__REPO_ARCH}/${STABLE_REV}" SALTSTACK_DEBIAN_URL="${HTTP_VAL}://repo.saltstack.com/apt/debian/${DISTRO_MAJOR_VERSION}/${__REPO_ARCH}/${STABLE_REV}"
echo "deb $SALTSTACK_DEBIAN_URL wheezy main" > "/etc/apt/sources.list.d/saltstack.list" echo "deb $SALTSTACK_DEBIAN_URL wheezy main" > "/etc/apt/sources.list.d/saltstack.list"
@ -2841,6 +2832,9 @@ install_debian_7_deps() {
# Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
__PACKAGES='procps pciutils' __PACKAGES='procps pciutils'
# YAML module is used for generating custom master/minion configs
__PACKAGES="${__PACKAGES} python-yaml"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
__apt_get_install_noinput ${__PACKAGES} || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1
@ -2896,7 +2890,7 @@ install_debian_8_deps() {
fi fi
# Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com # Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com
if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|latest|archive\/201[5-6]\.)')" != "" ]; then if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/201[5-6]\.)')" != "" ]; then
SALTSTACK_DEBIAN_URL="${HTTP_VAL}://repo.saltstack.com/apt/debian/${DISTRO_MAJOR_VERSION}/${__REPO_ARCH}/${STABLE_REV}" SALTSTACK_DEBIAN_URL="${HTTP_VAL}://repo.saltstack.com/apt/debian/${DISTRO_MAJOR_VERSION}/${__REPO_ARCH}/${STABLE_REV}"
echo "deb $SALTSTACK_DEBIAN_URL jessie main" > "/etc/apt/sources.list.d/saltstack.list" echo "deb $SALTSTACK_DEBIAN_URL jessie main" > "/etc/apt/sources.list.d/saltstack.list"
@ -2920,9 +2914,8 @@ install_debian_8_deps() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
__apt_get_install_noinput ${__PACKAGES} || return 1 __apt_get_install_noinput ${__PACKAGES} || return 1
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then # YAML module is used for generating custom master/minion configs
__apt_get_upgrade_noinput || return 1 __PACKAGES="${__PACKAGES} python-yaml"
fi
if [ "${_EXTRA_PACKAGES}" != "" ]; then if [ "${_EXTRA_PACKAGES}" != "" ]; then
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
@ -2938,10 +2931,14 @@ install_debian_git_deps() {
__apt_get_install_noinput git || return 1 __apt_get_install_noinput git || return 1
fi fi
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
__apt_get_install_noinput ca-certificates
fi
__git_clone_and_checkout || return 1 __git_clone_and_checkout || return 1
__PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname python-crypto" __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname python-crypto"
__PACKAGES="${__PACKAGES} python-jinja2 python-msgpack python-requests python-tornado" __PACKAGES="${__PACKAGES} python-jinja2 python-msgpack python-requests"
__PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq" __PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq"
if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
@ -2975,9 +2972,14 @@ install_debian_8_git_deps() {
__apt_get_install_noinput git || return 1 __apt_get_install_noinput git || return 1
fi fi
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
__apt_get_install_noinput ca-certificates
fi
__git_clone_and_checkout || return 1 __git_clone_and_checkout || return 1
__PACKAGES='libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2 python-msgpack python-requests python-yaml python-zmq' __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2 python-msgpack"
__PACKAGES="${__PACKAGES} python-requests python-systemd python-yaml python-zmq"
if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
# Install python-libcloud if asked to # Install python-libcloud if asked to
@ -3184,16 +3186,7 @@ install_debian_check_services() {
# Fedora Install Functions # Fedora Install Functions
# #
FEDORA_PACKAGE_MANAGER="yum"
__fedora_get_package_manager() {
if [ "$DISTRO_MAJOR_VERSION" -ge 22 ] || __check_command_exists dnf; then
FEDORA_PACKAGE_MANAGER="dnf"
fi
}
install_fedora_deps() { install_fedora_deps() {
__fedora_get_package_manager
if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then
@ -3203,32 +3196,25 @@ install_fedora_deps() {
__install_saltstack_copr_salt_repository || return 1 __install_saltstack_copr_salt_repository || return 1
fi fi
__PACKAGES="yum-utils PyYAML libyaml python-crypto python-jinja2 python-zmq" __PACKAGES="yum-utils PyYAML libyaml python-crypto python-jinja2 python-zmq python2-msgpack python2-requests"
if [ "$DISTRO_MAJOR_VERSION" -ge 23 ]; then
__PACKAGES="${__PACKAGES} python2-msgpack python2-requests"
else
__PACKAGES="${__PACKAGES} python-msgpack python-requests"
fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 dnf install -y ${__PACKAGES} || return 1
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
$FEDORA_PACKAGE_MANAGER -y update || return 1 dnf -y update || return 1
fi fi
if [ "${_EXTRA_PACKAGES}" != "" ]; then if [ "${_EXTRA_PACKAGES}" != "" ]; then
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$FEDORA_PACKAGE_MANAGER install -y ${_EXTRA_PACKAGES} || return 1 dnf install -y ${_EXTRA_PACKAGES} || return 1
fi fi
return 0 return 0
} }
install_fedora_stable() { install_fedora_stable() {
__fedora_get_package_manager
__PACKAGES="" __PACKAGES=""
if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then
@ -3245,7 +3231,7 @@ install_fedora_stable() {
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 dnf install -y ${__PACKAGES} || return 1
return 0 return 0
} }
@ -3267,11 +3253,15 @@ install_fedora_stable_post() {
} }
install_fedora_git_deps() { install_fedora_git_deps() {
__fedora_get_package_manager
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
dnf install -y ca-certificates || return 1
fi
install_fedora_deps || return 1 install_fedora_deps || return 1
if ! __check_command_exists git; then if ! __check_command_exists git; then
$FEDORA_PACKAGE_MANAGER install -y git || return 1 dnf install -y git || return 1
fi fi
__git_clone_and_checkout || return 1 __git_clone_and_checkout || return 1
@ -3299,7 +3289,7 @@ install_fedora_git_deps() {
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
$FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 dnf install -y ${__PACKAGES} || return 1
if [ "${__PIP_PACKAGES}" != "" ]; then if [ "${__PIP_PACKAGES}" != "" ]; then
# shellcheck disable=SC2086,SC2090 # shellcheck disable=SC2086,SC2090
@ -3449,7 +3439,13 @@ __install_saltstack_rhel_repository() {
repo_url="repo.saltstack.com" repo_url="repo.saltstack.com"
fi fi
base_url="${HTTP_VAL}://${repo_url}/yum/redhat/\$releasever/\$basearch/${repo_rev}/" # Cloud Linux $releasever = 7.x, which doesn't exist in repo.saltstack.com, we need this to be "7"
if [ "${DISTRO_NAME}" = "Cloud Linux" ] && [ "${DISTRO_MAJOR_VERSION}" = "7" ]; then
base_url="${HTTP_VAL}://${repo_url}/yum/redhat/${DISTRO_MAJOR_VERSION}/\$basearch/${repo_rev}/"
else
base_url="${HTTP_VAL}://${repo_url}/yum/redhat/\$releasever/\$basearch/${repo_rev}/"
fi
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}/"
if [ "${DISTRO_MAJOR_VERSION}" -eq 5 ]; then if [ "${DISTRO_MAJOR_VERSION}" -eq 5 ]; then
@ -3528,14 +3524,23 @@ install_centos_stable_deps() {
__PACKAGES="yum-utils chkconfig" __PACKAGES="yum-utils chkconfig"
if [ "${_EXTRA_PACKAGES}" != "" ]; then # YAML module is used for generating custom master/minion configs
echoinfo "Also installing the following extra packages as requested: ${_EXTRA_PACKAGES}" if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then
__PACKAGES="${__PACKAGES} ${_EXTRA_PACKAGES}" __PACKAGES="${__PACKAGES} python26-PyYAML"
else
__PACKAGES="${__PACKAGES} PyYAML"
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2086
__yum_install_noinput ${__PACKAGES} || return 1 __yum_install_noinput ${__PACKAGES} || return 1
if [ "${_EXTRA_PACKAGES}" != "" ]; then
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
# shellcheck disable=SC2086
__yum_install_noinput ${_EXTRA_PACKAGES} || return 1
fi
return 0 return 0
} }
@ -3574,7 +3579,7 @@ install_centos_stable_post() {
[ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue
if [ -f /bin/systemctl ]; then if [ -f /bin/systemctl ]; then
/usr/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || ( /bin/systemctl is-enabled salt-${fname}.service > /dev/null 2>&1 || (
/bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && /bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 &&
/bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 /bin/systemctl enable salt-${fname}.service > /dev/null 2>&1
) )
@ -3593,6 +3598,14 @@ install_centos_stable_post() {
} }
install_centos_git_deps() { install_centos_git_deps() {
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
if [ "$DISTRO_MAJOR_VERSION" -gt 5 ]; then
__yum_install_noinput ca-certificates || return 1
else
__yum_install_noinput "openssl.${CPU_ARCH_L}" || return 1
fi
fi
install_centos_stable_deps || return 1 install_centos_stable_deps || return 1
if ! __check_command_exists git; then if ! __check_command_exists git; then
@ -3604,10 +3617,10 @@ install_centos_git_deps() {
__PACKAGES="" __PACKAGES=""
if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then
__PACKAGES="${__PACKAGES} python26-PyYAML python26 python26-requests" __PACKAGES="${__PACKAGES} python26 python26-crypto python26-jinja2 python26-msgpack python26-requests"
__PACKAGES="${__PACKAGES} python26-crypto python26-jinja2 python26-msgpack python26-tornado python26-zmq" __PACKAGES="${__PACKAGES} python26-tornado python26-zmq"
else else
__PACKAGES="${__PACKAGES} PyYAML python-crypto python-futures python-msgpack python-zmq python-jinja2" __PACKAGES="${__PACKAGES} python-crypto python-futures python-msgpack python-zmq python-jinja2"
__PACKAGES="${__PACKAGES} python-requests python-tornado" __PACKAGES="${__PACKAGES} python-requests python-tornado"
fi fi
@ -4082,6 +4095,69 @@ install_scientific_linux_check_services() {
# #
####################################################################################################################### #######################################################################################################################
#######################################################################################################################
#
# CloudLinux Install Functions
#
install_cloud_linux_stable_deps() {
install_centos_stable_deps || return 1
return 0
}
install_cloud_linux_git_deps() {
install_centos_git_deps || return 1
return 0
}
install_cloud_linux_testing_deps() {
install_centos_testing_deps || return 1
return 0
}
install_cloud_linux_stable() {
install_centos_stable || return 1
return 0
}
install_cloud_linux_git() {
install_centos_git || return 1
return 0
}
install_cloud_linux_testing() {
install_centos_testing || return 1
return 0
}
install_cloud_linux_stable_post() {
install_centos_stable_post || return 1
return 0
}
install_cloud_linux_git_post() {
install_centos_git_post || return 1
return 0
}
install_cloud_linux_testing_post() {
install_centos_testing_post || return 1
return 0
}
install_cloud_linux_restart_daemons() {
install_centos_restart_daemons || return 1
return 0
}
install_cloud_linux_check_services() {
install_centos_check_services || return 1
return 0
}
#
# End of CloudLinux Install Functions
#
#######################################################################################################################
####################################################################################################################### #######################################################################################################################
# #
# Amazon Linux AMI Install Functions # Amazon Linux AMI Install Functions
@ -4089,6 +4165,10 @@ install_scientific_linux_check_services() {
install_amazon_linux_ami_deps() { install_amazon_linux_ami_deps() {
# We need to install yum-utils before doing anything else when installing on
# Amazon Linux ECS-optimized images. See issue #974.
yum -y install yum-utils
ENABLE_EPEL_CMD="" ENABLE_EPEL_CMD=""
if [ $_DISABLE_REPOS -eq $BS_TRUE ]; then if [ $_DISABLE_REPOS -eq $BS_TRUE ]; then
ENABLE_EPEL_CMD="--enablerepo=${_EPEL_REPO}" ENABLE_EPEL_CMD="--enablerepo=${_EPEL_REPO}"
@ -4133,6 +4213,10 @@ _eof
} }
install_amazon_linux_ami_git_deps() { install_amazon_linux_ami_git_deps() {
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
yum -y install ca-certificates || return 1
fi
install_amazon_linux_ami_deps || return 1 install_amazon_linux_ami_deps || return 1
ENABLE_EPEL_CMD="" ENABLE_EPEL_CMD=""
@ -4238,6 +4322,9 @@ install_arch_linux_stable_deps() {
pacman-db-upgrade || return 1 pacman-db-upgrade || return 1
fi fi
# YAML module is used for generating custom master/minion configs
pacman -Sy --noconfirm --needed python2-yaml
if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then
pacman -Syyu --noconfirm --needed || return 1 pacman -Syyu --noconfirm --needed || return 1
fi fi
@ -4262,7 +4349,7 @@ install_arch_linux_git_deps() {
fi fi
pacman -R --noconfirm python2-distribute pacman -R --noconfirm python2-distribute
pacman -Sy --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ pacman -Sy --noconfirm --needed python2-crypto python2-setuptools python2-jinja \
python2-markupsafe python2-msgpack python2-psutil python2-yaml \ python2-markupsafe python2-msgpack python2-psutil \
python2-pyzmq zeromq python2-requests python2-systemd || return 1 python2-pyzmq zeromq python2-requests python2-systemd || return 1
__git_clone_and_checkout || return 1 __git_clone_and_checkout || return 1
@ -4293,7 +4380,7 @@ install_arch_linux_stable() {
pacman -S --noconfirm --needed bash || return 1 pacman -S --noconfirm --needed bash || return 1
pacman -Su --noconfirm || return 1 pacman -Su --noconfirm || return 1
# We can now resume regular salt update # We can now resume regular salt update
pacman -Syu --noconfirm salt-zmq || return 1 pacman -Syu --noconfirm salt || return 1
return 0 return 0
} }
@ -4515,6 +4602,10 @@ install_freebsd_9_stable_deps() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
/usr/local/sbin/pkg install ${FROM_FREEBSD} -y swig || return 1 /usr/local/sbin/pkg install ${FROM_FREEBSD} -y swig || return 1
# YAML module is used for generating custom master/minion configs
# shellcheck disable=SC2086
/usr/local/sbin/pkg install ${FROM_FREEBSD} -y py27-yaml || return 1
if [ "${_EXTRA_PACKAGES}" != "" ]; then if [ "${_EXTRA_PACKAGES}" != "" ]; then
echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
@ -5027,8 +5118,7 @@ __ZYPPER_REQUIRES_REPLACE_FILES=-1
__set_suse_pkg_repo() { __set_suse_pkg_repo() {
suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo"
if [ "$_DOWNSTREAM_PKG_REPO" -eq $BS_TRUE ]; then if [ "$_DOWNSTREAM_PKG_REPO" -eq $BS_TRUE ]; then
# FIXME: cleartext download over unsecure protocol (HTTP) suse_pkg_url_base="http://download.opensuse.org/repositories/systemsmanagement:/saltstack"
suse_pkg_url_base="http://download.opensuse.org/repositories/systemsmanagement:saltstack"
else else
suse_pkg_url_base="${HTTP_VAL}://repo.saltstack.com/opensuse" suse_pkg_url_base="${HTTP_VAL}://repo.saltstack.com/opensuse"
fi fi
@ -5127,6 +5217,10 @@ install_opensuse_stable_deps() {
} }
install_opensuse_git_deps() { install_opensuse_git_deps() {
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
__zypper_install ca-certificates || return 1
fi
install_opensuse_stable_deps || return 1 install_opensuse_stable_deps || return 1
if ! __check_command_exists git; then if ! __check_command_exists git; then
@ -5917,7 +6011,7 @@ config_salt() {
# Copy the minions configuration if found # Copy the minions configuration if found
# Explicitly check for custom master config to avoid moving the minion config # Explicitly check for custom master config to avoid moving the minion config
elif [ -f "$_TEMP_CONFIG_DIR/minion" ] && [ "$_CUSTOM_MASTER_CONFIG" = "null" ]; then elif [ -f "$_TEMP_CONFIG_DIR/minion" ] && [ "$_CUSTOM_MASTER_CONFIG" = "null" ]; then
__movefile "$_TEMP_CONFIG_DIR/minion" "$_SALT_ETC_DIR" "$_CONFIG_ONLY" || return 1 __movefile "$_TEMP_CONFIG_DIR/minion" "$_SALT_ETC_DIR" "$_FORCE_OVERWRITE" || return 1
CONFIGURED_ANYTHING=$BS_TRUE CONFIGURED_ANYTHING=$BS_TRUE
fi fi
@ -6008,9 +6102,6 @@ config_salt() {
exit 0 exit 0
fi fi
# Create default logs directory if not exists
mkdir -p /var/log/salt
return 0 return 0
} }
# #
@ -6116,7 +6207,7 @@ for FUNC_NAME in $(__strip_duplicates "$DEP_FUNC_NAMES"); do
done done
echodebug "DEPS_INSTALL_FUNC=${DEPS_INSTALL_FUNC}" echodebug "DEPS_INSTALL_FUNC=${DEPS_INSTALL_FUNC}"
# Let's get the minion config function # Let's get the Salt config function
CONFIG_FUNC_NAMES="config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_salt" CONFIG_FUNC_NAMES="config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_salt"
CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt" CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_salt"
CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt" CONFIG_FUNC_NAMES="$CONFIG_FUNC_NAMES config_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_salt"
@ -6265,6 +6356,16 @@ if [ "$_CUSTOM_MASTER_CONFIG" != "null" ] || [ "$_CUSTOM_MINION_CONFIG" != "null
if [ "$_TEMP_CONFIG_DIR" = "null" ]; then if [ "$_TEMP_CONFIG_DIR" = "null" ]; then
_TEMP_CONFIG_DIR="$_SALT_ETC_DIR" _TEMP_CONFIG_DIR="$_SALT_ETC_DIR"
fi fi
if [ "$_CONFIG_ONLY" -eq $BS_TRUE ]; then
# Execute function to satisfy dependencies for configuration step
echoinfo "Running ${DEPS_INSTALL_FUNC}()"
$DEPS_INSTALL_FUNC
if [ $? -ne 0 ]; then
echoerror "Failed to run ${DEPS_INSTALL_FUNC}()!!!"
exit 1
fi
fi
fi fi
# Configure Salt # Configure Salt
@ -6277,7 +6378,21 @@ if [ "$CONFIG_SALT_FUNC" != "null" ] && [ "$_TEMP_CONFIG_DIR" != "null" ]; then
fi fi
fi fi
# Pre-Seed master keys # Drop the master address if passed
if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then
[ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d"
cat <<_eof > $_SALT_ETC_DIR/minion.d/99-master-address.conf
master: $_SALT_MASTER_ADDRESS
_eof
fi
# Drop the minion id if passed
if [ "$_SALT_MINION_ID" != "null" ]; then
[ ! -d "$_SALT_ETC_DIR" ] && mkdir -p "$_SALT_ETC_DIR"
echo "$_SALT_MINION_ID" > "$_SALT_ETC_DIR/minion_id"
fi
# Pre-seed master keys
if [ "$PRESEED_MASTER_FUNC" != "null" ] && [ "$_TEMP_KEYS_DIR" != "null" ]; then if [ "$PRESEED_MASTER_FUNC" != "null" ] && [ "$_TEMP_KEYS_DIR" != "null" ]; then
echoinfo "Running ${PRESEED_MASTER_FUNC}()" echoinfo "Running ${PRESEED_MASTER_FUNC}()"
$PRESEED_MASTER_FUNC $PRESEED_MASTER_FUNC
@ -6298,29 +6413,6 @@ if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then
fi fi
fi fi
# Ensure that the cachedir exists
# (Workaround for https://github.com/saltstack/salt/issues/6502)
if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then
if [ ! -d "${_SALT_CACHE_DIR}/minion/proc" ]; then
echodebug "Creating salt's cachedir"
mkdir -p "${_SALT_CACHE_DIR}/minion/proc"
fi
fi
# Drop the master address if passed
if [ "$_SALT_MASTER_ADDRESS" != "null" ]; then
[ ! -d "$_SALT_ETC_DIR/minion.d" ] && mkdir -p "$_SALT_ETC_DIR/minion.d"
cat <<_eof > $_SALT_ETC_DIR/minion.d/99-master-address.conf
master: $_SALT_MASTER_ADDRESS
_eof
fi
# Drop the minion id if passed
if [ "$_SALT_MINION_ID" != "null" ]; then
[ ! -d "$_SALT_ETC_DIR" ] && mkdir -p "$_SALT_ETC_DIR"
echo "$_SALT_MINION_ID" > "$_SALT_ETC_DIR/minion_id"
fi
# Run any post install function. Only execute function if not in config mode only # Run any post install function. Only execute function if not in config mode only
if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then
echoinfo "Running ${POST_INSTALL_FUNC}()" echoinfo "Running ${POST_INSTALL_FUNC}()"