From dcf9dfda94c7cc70d37045843dd285d099c46219 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 13 Dec 2017 13:30:31 -0500 Subject: [PATCH 01/28] Add sum to README for 2017.12.13 release --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 37307ad..4eee91e 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,7 @@ of the downloaded ``bootstrap-salt.sh`` file. The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: +- 2017.12.13: ``c127b3aa4a8422f6b81f5b4a40d31d13cec97bf3a39bca9c11a28f24910a6895`` - 2017.08.17: ``909b4d35696b9867b34b22ef4b60edbc5a0e9f8d1ed8d05f922acb79a02e46e3`` - 2017.05.24: ``8c42c2e5ad3d4384ddc557da5c214ba3e40c056ca1b758d14a392c1364650e89`` From 790d2ab13d8a04b497c5450136f54a5fa0dfd351 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Thu, 14 Dec 2017 15:30:07 -0700 Subject: [PATCH 02/28] only install ca-certificates on opensuse if it isn't already installed --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a650299..a97fada 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5515,7 +5515,7 @@ install_opensuse_stable_deps() { } install_opensuse_git_deps() { - if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ] && ! __check_command_exists update-ca-certificates; then __zypper_install ca-certificates || return 1 fi From 9fb764dcb2fd0883727cb65dbb151b72165d8d38 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 15 Dec 2017 15:28:27 -0500 Subject: [PATCH 03/28] Wait for zypper processes to finish before calling zypper again Fixes an issue where the bootstrap script bails out if there is a zypper process running already on the machine to be bootstrapped. This can happen when a machine has been modified to use zypper in a boot command. We need to wait for the process to finish before calling the next zypper command. Otherwise, the following error occurs: ``` System management is locked by the application with pid (zypper). ``` --- bootstrap-salt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a97fada..5f28f39 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5456,6 +5456,13 @@ __version_lte() { } __zypper() { + # Check if any zypper process is running before calling zypper again. + # This is useful when a zypper call is part of a boot process and will + # wait until the zypper process is finished, such as on AWS AMIs. + while pgrep -l zypper; do + sleep 1 + done + zypper --non-interactive "${@}"; return $? } From 6eb2423d187fab7ef9da04f813821330bccf2d65 Mon Sep 17 00:00:00 2001 From: Charles McLaughlin Date: Mon, 25 Dec 2017 21:59:59 -0800 Subject: [PATCH 04/28] Adding support for minor release pinning on AWS Linux Currently Salt 2017.7.2 has a critical bug that has broke disk formatting for me: saltstack/salt#44029 That left me looking for a way to pin AWS Linux hosts launched from salt-cloud to an older release. With this change script args `stable 2017.7.1` now works with AWS Linux based on the "Pin to Minor Release" instructions listed at https://repo.saltstack.com/#amzn. As noted in the comments below this change, we should probably refactor to use `__install_saltstack_rhel_repository()`... in fact I've copied more code from that function... but I don't understand all the cases for all the other RedHat varients, so I'm just putting in the work for AWS Linux. --- bootstrap-salt.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5f28f39..c363a6e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4427,10 +4427,20 @@ install_amazon_linux_ami_deps() { _USEAWS=$BS_FALSE pkg_append="python" - repo_rev="$(echo "${STABLE_REV}" | sed 's|.*\/||g')" + if [ "$ITYPE" = "stable" ]; then + repo_rev="$STABLE_REV" + else + repo_rev="latest" + fi + + if [[ $repo_rev =~ ^archive ]]; then + year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) + else + year=$(echo "$repo_rev" | cut -c1-4) + fi if echo "$repo_rev" | egrep -q '^(latest|2016\.11)$' || \ - [ "$(echo "$repo_rev" | cut -c1-4)" -gt 2016 ]; then + [ "$year" -gt 2016 ]; then _USEAWS=$BS_TRUE pkg_append="python27" fi From b09dd90f0a1f6347613c20c84c87855333ee4eef Mon Sep 17 00:00:00 2001 From: Charles McLaughlin Date: Tue, 26 Dec 2017 21:11:48 -0800 Subject: [PATCH 05/28] PR feedback - POSIX compliance --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c363a6e..9dad80c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4433,7 +4433,7 @@ install_amazon_linux_ami_deps() { repo_rev="latest" fi - if [[ $repo_rev =~ ^archive ]]; then + if echo $repo_rev | egrep -q '^archive'; then year=$(echo "$repo_rev" | cut -d '/' -f 2 | cut -c1-4) else year=$(echo "$repo_rev" | cut -c1-4) From 630a2c4c54c5ea055d28fe38e322367b74019dfe Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 28 Dec 2017 09:07:15 -0500 Subject: [PATCH 06/28] Add a note about the use of sudo when running commands to README Fixes #880 --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4eee91e..6288645 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,8 @@ Examples -------- The Salt Bootstrap script has a wide variety of options that can be passed as -well as several ways of obtaining the bootstrap script itself. +well as several ways of obtaining the bootstrap script itself. Note that the use of ``sudo`` +is not needed when running these commands as the ``root`` user. **NOTE** From 262d50d9eb3a2ae498c8eb0509327dcfd74bbf26 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 28 Dec 2017 09:14:22 -0500 Subject: [PATCH 07/28] Update Fedora support: 25 is EOL, 27 is supported - Fedora 25 is EOL and no longer supported. - Fedora 27 is out and supported, let's update the docs. --- README.rst | 2 +- bootstrap-salt.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 6288645..c6392cd 100644 --- a/README.rst +++ b/README.rst @@ -255,7 +255,7 @@ Red Hat family - Amazon Linux 2012.3 and later - CentOS 6/7 - Cloud Linux 6/7 -- Fedora 25/26 +- Fedora 26/27 - Oracle Linux 6/7 - Red Hat Enterprise Linux 6/7 - Scientific Linux 6/7 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9dad80c..9bc374f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1544,8 +1544,8 @@ __check_end_of_life_versions() { ;; fedora) - # Fedora lower than 25 are no longer supported - if [ "$DISTRO_MAJOR_VERSION" -lt 25 ]; then + # Fedora lower than 26 are no longer supported + if [ "$DISTRO_MAJOR_VERSION" -lt 26 ]; then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://fedoraproject.org/wiki/Releases" From 938264f9e400948329a3c3f2b6f0d6a1711eb20c Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 28 Dec 2017 09:34:14 -0500 Subject: [PATCH 08/28] Update the README.rst file with some grammatical changes --- README.rst | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.rst b/README.rst index c6392cd..60868d9 100644 --- a/README.rst +++ b/README.rst @@ -15,7 +15,7 @@ install the `Salt`_ binaries using the appropriate methods. **NOTE** -This ``README`` file is not the absolute truth to what the bootstrap script is capable of, for +This ``README`` file is not the absolute truth as to what the bootstrap script is capable of. For that, please read the generated help by passing ``-h`` to the script or even better, `read the source`_. @@ -31,7 +31,7 @@ The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: - 2017.08.17: ``909b4d35696b9867b34b22ef4b60edbc5a0e9f8d1ed8d05f922acb79a02e46e3`` - 2017.05.24: ``8c42c2e5ad3d4384ddc557da5c214ba3e40c056ca1b758d14a392c1364650e89`` -If you're looking for the *one-liner* to install Salt, please scroll to the bottom and use the +If you're looking for a *one-liner* to install Salt, please scroll to the bottom and use the instructions for `Installing via an Insecure One-Liner`_. Contributing @@ -49,7 +49,7 @@ is not needed when running these commands as the ``root`` user. **NOTE** -These examples below show how to bootstrap Salt directly from GitHub or other Git repository. +The examples below show how to bootstrap Salt directly from GitHub or another Git repository. Run the script without any parameters to get latest stable Salt packages for your system from `SaltStack's corporate repository`_. See first example in the `Install using wget`_ section. @@ -113,14 +113,14 @@ Installing a specific version from git using ``wget``: **NOTE** -On the above example we added `-P` which will allow PIP packages to be installed if required but -it's not a necessary flag for Git based bootstraps. +On the above example we added ``-P`` which will allow PIP packages to be installed if required. +However, the ``-P`` flag is not necessary for Git-based bootstraps. Install using Python ~~~~~~~~~~~~~~~~~~~~ -If you already have Python installed, ``python 2.6``, then it's as easy as: +If you already have Python installed, ``python 2.7``, then it's as easy as: .. code:: console @@ -138,7 +138,7 @@ All Python versions should support the following in-line code: Install using fetch ~~~~~~~~~~~~~~~~~~~ -On a FreeBSD base system you usually don't have either of the above binaries available. You **do** +On a FreeBSD-based system you usually don't have either of the above binaries available. You **do** have ``fetch`` available though: .. code:: console @@ -175,7 +175,7 @@ The following examples illustrate how to install Salt via a one-liner. Warning! These methods do not involve a verification step and assume that the delivered file is trustworthy. -Any of the example above which use two-lines can be made to run in a single-line +Any of the examples above which use two lines can be made to run in a single-line configuration with minor modifications. Installing the latest stable release of Salt (default): @@ -288,8 +288,8 @@ For example, when installing Salt on Ubuntu 16.10, the bootstrap script will set for Ubuntu 16.04 from `SaltStack's Ubuntu repository`_ and install the 16.04 packages. -Other Linux distro -~~~~~~~~~~~~~~~~~~ +Other Linux distributions +~~~~~~~~~~~~~~~~~~~~~~~~~ - Alpine Linux 3.5/edge - Arch Linux @@ -311,27 +311,27 @@ UNIX systems Unsupported Distro ------------------ -You found a Linux distribution which we still do not support or we do not correctly identify? -Please run the following commands and report their output when creating a ticket: +If you are running a Linux distribution that is not supported yet or is not correctly identified, +please run the following commands and report their output when creating an issue: .. code:: console sudo find /etc/ -name \*-release -print -exec cat {} \; command lsb_release -a -For information on how to add support for a currently unsupported distro, please refer to the +For information on how to add support for a currently unsupported distribution, please refer to the `Contributing Guidelines`_. Testing ------- -There are a couple of ways to test the bootstrap script. Running the script on a full-fledged +There are a couple of ways to test the bootstrap script. Running the script on a fully-fledged VM is one way. Other options include using Vagrant or Docker. Testing in Vagrant ================== -You can use Vagrant_ to easily test changes on a clean machine. The ``Vagrantfile`` defaults to an +Vagrant_ can be used to easily test changes on a clean machine. The ``Vagrantfile`` defaults to an Ubuntu box. First, install Vagrant, then: .. code:: console @@ -342,9 +342,9 @@ Ubuntu box. First, install Vagrant, then: Running in Docker ================= -Also you are able to run and use Salt inside Docker_ container on Linux machine. -Let's prepare the Docker image using provided ``Dockerfile`` to install both Salt Master and Minion -with the bootstrap script: +It is possible to run and use Salt inside a Docker_ container on Linux machines. +Let's prepare the Docker image using the provided ``Dockerfile`` to install both a Salt Master +and a Salt Minion with the bootstrap script: .. code:: console @@ -363,17 +363,17 @@ And finally "enter" the running container and make Salt fully operational: docker exec -i -t salt /bin/bash salt-key -A -y -Salt is ready and working in the Docker container with Minion authenticated on Master. +Salt is ready and working in the Docker container with the Minion authenticated on the Master. **NOTE** -The ``Dockerfile`` here inherits Ubuntu 14.04 public image with Upstart configured as init system. -Consider it as an example or starting point of how to make your own Docker images with suitable -Salt components, custom configurations and even `pre-accepted Minion key`_ already installed. +The ``Dockerfile`` here inherits the Ubuntu 14.04 public image with Upstart configured as the init system. +Use it as an example or starting point of how to make your own Docker images with suitable +Salt components, custom configurations, and even `pre-accepted Minion keys`_ already installed. .. _Contributing Guidelines: https://github.com/saltstack/salt-bootstrap/blob/develop/CONTRIBUTING.md .. _Docker: https://www.docker.com/ -.. _`pre-accepted Minion key`: https://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html +.. _`pre-accepted Minion keys`: https://docs.saltstack.com/en/latest/topics/tutorials/preseed_key.html .. _`read the source`: https://github.com/saltstack/salt-bootstrap/blob/develop/bootstrap-salt.sh .. _`Salt`: https://saltstack.com/community/ .. _`Salt's Supported Operating Systems`: http://saltstack.com/wp-content/uploads/2016/08/SaltStack-Supported-Operating-Systems.pdf From b30af3c5cf62411fae1669a13dfab2c6bed01f8e Mon Sep 17 00:00:00 2001 From: sybix Date: Sun, 31 Dec 2017 11:39:02 +0100 Subject: [PATCH 09/28] make salt-syndic optional on salt bootstrap --- bootstrap-salt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9bc374f..f2b7c8e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4367,6 +4367,7 @@ install_alpine_linux_restart_daemons() { # Skip if not meant to be installed [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # Disable stdin to fix shell session hang on killing tee pipe /sbin/rc-service salt-$fname stop < /dev/null > /dev/null 2>&1 @@ -4382,6 +4383,7 @@ install_alpine_linux_check_services() { # Skip if not meant to be installed [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue __check_services_alpine salt-$fname || return 1 done @@ -4400,6 +4402,7 @@ daemons_running_alpine_linux() { # Skip if not meant to be installed [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue + [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue # shellcheck disable=SC2009 if [ "$(ps wwwaux | grep -v grep | grep salt-$fname)" = "" ]; then From 94b86f28df6d1539bcdc6f25a0b6ee0fbb3d7e8e Mon Sep 17 00:00:00 2001 From: abednarik Date: Thu, 4 Jan 2018 09:38:58 -0300 Subject: [PATCH 10/28] Install swig30 as freebsd dep instead of swig. Looks like swig was removed from FreeBSD Ports. See https://www.freshports.org/commit.php?category=devel&port=swig13&files=yes&message_id=201712201528.vBKFSwpR091538@repo.freebsd.org --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f2b7c8e..3324b6a 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4898,9 +4898,9 @@ install_freebsd_9_stable_deps() { __configure_freebsd_pkg_details || return 1 fi - # Now install swig + # Now install swig30 # shellcheck disable=SC2086 - /usr/local/sbin/pkg install ${FROM_FREEBSD} -y swig || return 1 + /usr/local/sbin/pkg install ${FROM_FREEBSD} -y swig30 || return 1 # YAML module is used for generating custom master/minion configs # shellcheck disable=SC2086 From 60600c7b6ced9f6ec72e924f895dc80a94115638 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 28 Dec 2017 10:04:42 -0500 Subject: [PATCH 11/28] Add __wait_for_apt function: avoid locking on the apt-get process Fixes #1163 I also updated some of the example versions from 2016.x versions to use newer 2017.7 versions. --- bootstrap-salt.sh | 53 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 46 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3324b6a..9149b1a 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -299,13 +299,13 @@ __usage() { Examples: - ${__ScriptName} - ${__ScriptName} stable - - ${__ScriptName} stable 2016.3 - - ${__ScriptName} stable 2016.3.1 + - ${__ScriptName} stable 2017.7 + - ${__ScriptName} stable 2017.7.2 - ${__ScriptName} daily - ${__ScriptName} testing - ${__ScriptName} git - - ${__ScriptName} git 2016.3 - - ${__ScriptName} git v2016.3.1 + - ${__ScriptName} git 2017.7 + - ${__ScriptName} git v2017.7.2 - ${__ScriptName} git 06f249901a2e2f1ed310d58ea3921a129f214358 Options: @@ -395,7 +395,7 @@ __usage() { tested with Centos 6 and is considered experimental. This will install the ius repo on the box if disable repo is false. This must be used in conjunction with -x . For example: - sh bootstrap.sh -P -y -x python2.7 git v2016.11.3 + sh bootstrap.sh -P -y -x python2.7 git v2017.7.2 The above will install python27 and install the git version of salt using the python2.7 executable. This only works for git and pip installations. @@ -1331,10 +1331,10 @@ __check_dpkg_architecture() { if [ "${error_msg}" != "" ]; then echoerror "${error_msg}" if [ "$ITYPE" != "git" ]; then - echoerror "You can try git installation mode, i.e.: sh ${__ScriptName} git v2016.11.5." + echoerror "You can try git installation mode, i.e.: sh ${__ScriptName} git v2017.7.2." echoerror "It may be necessary to use git installation mode with pip and disable the SaltStack apt repository." echoerror "For example:" - echoerror " sh ${__ScriptName} -r -P git v2016.11.5" + echoerror " sh ${__ScriptName} -r -P git v2017.7.2" fi fi @@ -1765,12 +1765,41 @@ __function_defined() { } +#--- FUNCTION ------------------------------------------------------------------------------------------------------- +# NAME: __wait_for_apt +# DESCRIPTION: Check if any apt, apt-get, aptitude, or dpkg processes are running before +# calling these again. This is useful when these process calls are part of +# a boot process, such as on AWS AMIs. This func will wait until the boot +# process is finished so the script doesn't exit on a locked proc. +#---------------------------------------------------------------------------------------------------------------------- +__wait_for_apt(){ + echodebug "Checking if apt process is currently running." + + # Timeout set at 15 minutes + WAIT_TIMEOUT=900 + + while ps -C apt,apt-get,aptitude,dpkg >/dev/null; do + sleep 1 + WAIT_TIMEOUT=$((WAIT_TIMEOUT - 1)) + + # If timeout reaches 0, abort. + if [ "$WAIT_TIMEOUT" -eq 0 ]; then + echoerror "Apt, apt-get, aptitude, or dpkg process is taking too long." + echoerror "Bootstrap script cannot proceed. Aborting." + return 1 + fi + done + + echodebug "No apt processes are currently running." +} + #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __apt_get_install_noinput # DESCRIPTION: (DRY) apt-get install with noinput options # PARAMETERS: packages #---------------------------------------------------------------------------------------------------------------------- __apt_get_install_noinput() { + __wait_for_apt apt-get install -y -o DPkg::Options::=--force-confold "${@}"; return $? } # ---------- end of function __apt_get_install_noinput ---------- @@ -1780,6 +1809,7 @@ __apt_get_install_noinput() { # DESCRIPTION: (DRY) apt-get upgrade with noinput options #---------------------------------------------------------------------------------------------------------------------- __apt_get_upgrade_noinput() { + __wait_for_apt apt-get upgrade -y -o DPkg::Options::=--force-confold; return $? } # ---------- end of function __apt_get_upgrade_noinput ---------- @@ -1790,6 +1820,7 @@ __apt_get_upgrade_noinput() { # PARAMETERS: url #---------------------------------------------------------------------------------------------------------------------- __apt_key_fetch() { + __wait_for_apt url=$1 # shellcheck disable=SC2086 @@ -2576,6 +2607,7 @@ __install_saltstack_ubuntu_repository() { __apt_key_fetch "$SALTSTACK_UBUNTU_URL/SALTSTACK-GPG-KEY.pub" || return 1 + __wait_for_apt apt-get update } @@ -2588,6 +2620,7 @@ install_ubuntu_deps() { __enable_universe_repository || return 1 + __wait_for_apt apt-get update fi @@ -2644,6 +2677,7 @@ install_ubuntu_stable_deps() { # No user interaction, libc6 restart services for example export DEBIAN_FRONTEND=noninteractive + __wait_for_apt apt-get update if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then @@ -2664,6 +2698,7 @@ install_ubuntu_stable_deps() { } install_ubuntu_daily_deps() { + __wait_for_apt install_ubuntu_stable_deps || return 1 if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then @@ -2681,6 +2716,7 @@ install_ubuntu_daily_deps() { } install_ubuntu_git_deps() { + __wait_for_apt apt-get update if ! __check_command_exists git; then @@ -2973,6 +3009,7 @@ __install_saltstack_debian_repository() { __apt_key_fetch "$SALTSTACK_DEBIAN_URL/SALTSTACK-GPG-KEY.pub" || return 1 + __wait_for_apt apt-get update } @@ -2984,6 +3021,7 @@ install_debian_deps() { # No user interaction, libc6 restart services for example export DEBIAN_FRONTEND=noninteractive + __wait_for_apt apt-get update if [ "${_UPGRADE_SYS}" -eq $BS_TRUE ]; then @@ -3096,6 +3134,7 @@ install_debian_8_git_deps() { /etc/apt/sources.list.d/backports.list fi + __wait_for_apt apt-get update || return 1 # python-tornado package should be installed from backports repo From 6a4b3c2c11031a57cb2c42bc26621e4aceb42234 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 22 Jan 2018 13:15:28 -0500 Subject: [PATCH 12/28] Change gnupg2 pacakge to gnupg for non-LTS versions of Ubuntu The gnupg2 package has been removed as it is just a dummy translation package. We need to be installing gnupg instead. This also adds best-effort support for the "Artful Aardvark" (17.10) version and removes support for "Zesty Zapus" (17.04) and "Yakkety Yak" (16.10). Both releases are EOL. --- README.rst | 2 +- bootstrap-salt.sh | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 60868d9..191b1be 100644 --- a/README.rst +++ b/README.rst @@ -284,7 +284,7 @@ repositories are not provided on `SaltStack's Ubuntu repository`_ for the non-LT 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 example, when installing Salt on Ubuntu 17.10, the bootstrap script will setup the repository for Ubuntu 16.04 from `SaltStack's Ubuntu repository`_ and install the 16.04 packages. diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9149b1a..f243296 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1372,16 +1372,10 @@ __ubuntu_codename_translation() { DISTRO_CODENAME="trusty" ;; "16") - if [ "$_april" ]; then - DISTRO_CODENAME="xenial" - else - DISTRO_CODENAME="yakkety" - fi + DISTRO_CODENAME="xenial" ;; "17") - if [ "$_april" ]; then - DISTRO_CODENAME="zesty" - fi + DISTRO_CODENAME="artful" ;; *) DISTRO_CODENAME="trusty" @@ -1500,9 +1494,12 @@ __check_end_of_life_versions() { # < 14.04 # = 14.10 # = 15.04, 15.10 + # = 16.10 + # = 17.04 if [ "$DISTRO_MAJOR_VERSION" -lt 14 ] || \ [ "$DISTRO_MAJOR_VERSION" -eq 15 ] || \ - ([ "$DISTRO_MAJOR_VERSION" -lt 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then + ([ "$DISTRO_MAJOR_VERSION" -eq 17 ] && [ "$DISTRO_MINOR_VERSION" -eq 04 ]) || \ + ([ "$DISTRO_MAJOR_VERSION" -lt 17 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.ubuntu.com/Releases" @@ -2575,7 +2572,7 @@ __enable_universe_repository() { __install_saltstack_ubuntu_repository() { # Workaround for latest non-LTS ubuntu - if [ "$DISTRO_VERSION" = "16.10" ] || [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then + if [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." UBUNTU_VERSION=16.04 UBUNTU_CODENAME="xenial" @@ -2587,8 +2584,8 @@ __install_saltstack_ubuntu_repository() { __PACKAGES='' # Install downloader backend for GPG keys fetching - if [ "$DISTRO_VERSION" = "16.10" ] || [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then - __PACKAGES="${__PACKAGES} gnupg2 dirmngr" + if [ "$DISTRO_MAJOR_VERSION" -gt 16 ]; then + __PACKAGES="${__PACKAGES} gnupg dirmngr" else __PACKAGES="${__PACKAGES} gnupg-curl" fi From 6f1f4cae0b63feaf63a5628086a7fda38b9aadec Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Thu, 25 Jan 2018 12:14:43 +0100 Subject: [PATCH 13/28] OpenBSD has a cdn which handles selecting the best mirror Set the mirror by overwriting the installurl file which can only contain a single line so the original behaviour of appending might not have worked reliably. The user can pass '-r' to disable setting the repos already to opt-out of this behaviour. --- bootstrap-salt.sh | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f243296..f9938d4 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5147,35 +5147,11 @@ install_freebsd_restart_daemons() { # OpenBSD Install Functions # -__choose_openbsd_mirror() { - OPENBSD_REPO='' - MINTIME='' - MIRROR_LIST=$(ftp -w 15 -Vao - 'https://ftp.openbsd.org/cgi-bin/ftplist.cgi?dbversion=1' | awk '/^http/ {print $1}') - - for MIRROR in $MIRROR_LIST; do - MIRROR_HOST=$(echo "$MIRROR" | sed -e 's|.*//||' -e 's|+*/.*$||') - TIME=$(ping -c 1 -w 1 -q "$MIRROR_HOST" | awk -F/ '/round-trip/ { print $5 }') - [ -z "$TIME" ] && continue - - echodebug "ping time for $MIRROR_HOST is $TIME" - if [ -z "$MINTIME" ]; then - FASTER_MIRROR=1 - else - FASTER_MIRROR=$(echo "$TIME < $MINTIME" | bc) - fi - if [ "$FASTER_MIRROR" -eq 1 ]; then - MINTIME=$TIME - OPENBSD_REPO="$MIRROR" - fi - done -} - install_openbsd_deps() { if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then - __choose_openbsd_mirror || return 1 - echoinfo "setting package repository to $OPENBSD_REPO with ping time of $MINTIME" - [ -n "$OPENBSD_REPO" ] || return 1 - echo "${OPENBSD_REPO}" >>/etc/installurl || return 1 + OPENBSD_REPO='https://cdn.openbsd.org/pub/OpenBSD' + echoinfo "setting package repository to $OPENBSD_REPO" + echo "${OPENBSD_REPO}" >/etc/installurl || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then From 4476ddcb9bed1a54b6155e5a658494d0bc5bb284 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 26 Jan 2018 12:26:45 -0500 Subject: [PATCH 14/28] Add M2Crypto package back to git install functions This is due to the change in Salt for Oxygen: https://github.com/saltstack/salt/pull/44962 --- bootstrap-salt.sh | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f243296..524b966 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2744,8 +2744,8 @@ install_ubuntu_git_deps() { else install_ubuntu_stable_deps || return 1 - __PACKAGES="${__PACKAGES} python-crypto python-jinja2 python-msgpack python-requests" - __PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq" + __PACKAGES="${__PACKAGES} python-crypto python-jinja2 python-m2crypto python-msgpack" + __PACKAGES="${__PACKAGES} python-requests python-tornado python-yaml python-zmq" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # Install python-libcloud if asked to @@ -3065,9 +3065,9 @@ install_debian_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname python-crypto" - __PACKAGES="${__PACKAGES} python-jinja2 python-msgpack python-requests" - __PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq" + __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname" + __PACKAGES="${__PACKAGES} python-crypto python-jinja2 python-msgpack python-m2crypto" + __PACKAGES="${__PACKAGES} python-requests python-tornado python-yaml python-zmq" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # Install python-libcloud if asked to @@ -3106,8 +3106,9 @@ install_debian_8_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2 python-msgpack" - __PACKAGES="${__PACKAGES} python-requests python-systemd python-yaml python-zmq" + __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2" + __PACKAGES="${__PACKAGES} python-m2crypto python-msgpack python-requests python-systemd" + __PACKAGES="${__PACKAGES} python-yaml python-zmq" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # Install python-libcloud if asked to @@ -3171,8 +3172,8 @@ install_debian_9_git_deps() { __git_clone_and_checkout || return 1 __PACKAGES="libzmq5 lsb-release python-apt python-backports-abc python-crypto" - __PACKAGES="${__PACKAGES} python-jinja2 python-msgpack python-requests python-systemd" - __PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq" + __PACKAGES="${__PACKAGES} python-jinja2 python-m2crypto python-msgpack python-requests" + __PACKAGES="${__PACKAGES} python-systemd python-tornado python-yaml python-zmq" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then # Install python-libcloud if asked to @@ -3374,7 +3375,8 @@ install_fedora_deps() { __install_saltstack_copr_salt_repository || return 1 fi - __PACKAGES="PyYAML libyaml python-crypto python-jinja2 python-zmq python2-msgpack python2-requests" + __PACKAGES="libyaml m2crypto PyYAML python-crypto python-jinja2" + __PACKAGES="${__PACKAGES} python2-msgpack python2-requests python-zmq" if [ "$DISTRO_MAJOR_VERSION" -lt 26 ]; then __PACKAGES="${__PACKAGES} yum-utils" @@ -3724,7 +3726,8 @@ install_centos_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="python-crypto python-futures python-msgpack python-zmq python-jinja2 python-requests python-tornado" + __PACKAGES="m2crypto python-crypto python-futures python-jinja2 python-msgpack" + __PACKAGES="${__PACKAGES} python-requests python-tornado python-zmq" if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then __PACKAGES="${__PACKAGES} systemd-python" @@ -4311,7 +4314,7 @@ install_alpine_linux_stable_deps() { install_alpine_linux_git_deps() { install_alpine_linux_stable_deps || return 1 - apk -U add python2 py-virtualenv py2-crypto py2-setuptools \ + apk -U add python2 py-virtualenv py2-crypto py2-m2crypto py2-setuptools \ py2-jinja2 py2-yaml py2-markupsafe py2-msgpack py2-psutil \ py2-zmq zeromq py2-requests || return 1 @@ -4526,7 +4529,8 @@ _eof # Package python-ordereddict-1.1-2.el6.noarch is obsoleted by python26-2.6.9-2.88.amzn1.x86_64 # which is already installed - __PACKAGES="${pkg_append}-PyYAML ${pkg_append}-crypto ${pkg_append}-msgpack ${pkg_append}-zmq ${pkg_append}-jinja2 ${pkg_append}-requests" + __PACKAGES="m2crypto ${pkg_append}-crypto ${pkg_append}-jinja2 ${pkg_append}-PyYAML" + __PACKAGES="${__PACKAGES} ${pkg_append}-msgpack ${pkg_append}-requests ${pkg_append}-zmq" # shellcheck disable=SC2086 __yum_install_noinput ${__PACKAGES} || return 1 @@ -4679,7 +4683,7 @@ install_arch_linux_git_deps() { fi pacman -R --noconfirm python2-distribute pacman -Su --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ - python2-markupsafe python2-msgpack python2-psutil \ + python2-m2crypto python2-markupsafe python2-msgpack python2-psutil \ python2-pyzmq zeromq python2-requests python2-systemd || return 1 __git_clone_and_checkout || return 1 @@ -5275,7 +5279,7 @@ install_openbsd_restart_daemons() { # SmartOS Install Functions # install_smartos_deps() { - pkgin -y install zeromq py27-crypto py27-msgpack py27-yaml py27-jinja2 py27-zmq py27-requests || return 1 + pkgin -y install zeromq py27-crypto py27-m2crypto py27-msgpack py27-yaml py27-jinja2 py27-zmq py27-requests || return 1 # Set _SALT_ETC_DIR to SmartOS default if they didn't specify _SALT_ETC_DIR=${BS_SALT_ETC_DIR:-/opt/local/etc/salt} @@ -5585,7 +5589,7 @@ install_opensuse_git_deps() { __git_clone_and_checkout || return 1 - __PACKAGES="libzmq5 python-Jinja2 python-msgpack-python python-pycrypto python-pyzmq python-xml" + __PACKAGES="libzmq5 python-Jinja2 python-m2crypto python-msgpack-python python-pycrypto python-pyzmq python-xml" if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then # We're on the develop branch, install whichever tornado is on the requirements file @@ -5779,6 +5783,12 @@ install_suse_12_stable_deps() { # shellcheck disable=SC2086,SC2090 __zypper_install ${__PACKAGES} || return 1 + # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which + # we want to install, even with --non-interactive. + # Let's try to install the higher version first and then the lower one in case of failure + __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 + + if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -5881,6 +5891,11 @@ install_suse_11_stable_deps() { # shellcheck disable=SC2086,SC2090 __zypper_install ${__PACKAGES} || return 1 + # SLES 11 SP3 ships with both python-M2Crypto-0.22.* and python-m2crypto-0.21 and we will be asked which + # we want to install, even with --non-interactive. + # Let's try to install the higher version first and then the lower one in case of failure + __zypper_install 'python-M2Crypto>=0.22' || __zypper_install 'python-M2Crypto>=0.21' || return 1 + if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 From d945972fc08499c3eb32fd7df1d1e05fe1026345 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 29 Jan 2018 08:55:27 -0500 Subject: [PATCH 15/28] Port spelling fixes from change in Salt to Bootstrap Refs https://github.com/saltstack/salt/pull/45747 --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f5dfce3..883ea2c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -95,7 +95,7 @@ echoinfo() { #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: echowarn -# DESCRIPTION: Echo warning informations to stdout. +# DESCRIPTION: Echo warning information to stdout. #---------------------------------------------------------------------------------------------------------------------- echowarn() { printf "${YC} * WARN${EC}: %s\n" "$@"; @@ -338,7 +338,7 @@ __usage() { -U If set, fully upgrade the system prior to bootstrapping Salt -I If set, allow insecure connections while downloading any files. For example, pass '--no-check-certificate' to 'wget' or '--insecure' to - 'curl'. On Debian and Ubuntu, using this option with -U allows to obtain + 'curl'. On Debian and Ubuntu, using this option with -U allows obtaining GnuPG archive keys insecurely if distro has changed release signatures. -F Allow copied files to overwrite existing (config, init.d, etc) -K If set, keep the temporary files in the temporary directories specified From 2932bae2fa4eb922a726b9ed91a0dad3da121fe6 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 30 Jan 2018 16:14:02 -0500 Subject: [PATCH 16/28] Update README to include mention of bootstrap-salt.ps1 for Windows --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 191b1be..9fded74 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,8 @@ Before `Salt`_ can be used for provisioning on the desired machine, the binaries installed. Since `Salt`_ supports many different distributions and versions of operating systems, the `Salt`_ installation process is handled by this shell script ``bootstrap-salt.sh``. This script runs through a series of checks to determine operating system type and version to then -install the `Salt`_ binaries using the appropriate methods. +install the `Salt`_ binaries using the appropriate methods. For Windows, use the +``bootstrap-salt.ps1`` script. **NOTE** From 1827473239fd4c93666fdf91076bb70134c67ea1 Mon Sep 17 00:00:00 2001 From: Ch3LL Date: Wed, 14 Feb 2018 18:44:05 -0500 Subject: [PATCH 17/28] Add M2Crypto to python27 centos 6 bootstrap install --- bootstrap-salt.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 883ea2c..491a4db 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3744,7 +3744,13 @@ install_centos_git_deps() { if [ "${_PY_EXE}" != "" ]; then # If "-x" is defined, install dependencies with pip based on the Python version given. - _PIP_PACKAGES="jinja2 msgpack-python pycrypto PyYAML tornado zmq" + _PIP_PACKAGES="m2crypto jinja2 msgpack-python pycrypto PyYAML tornado zmq" + + # install swig and openssl on cent6 + if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then + __M2C_DEPS="openssl-devel swig" + __yum_install_noinput ${__M2C_DEPS} || return 1 + fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then for SINGLE_PACKAGE in $_PIP_PACKAGES; do From de6a459405f66877db511643320102415bb2394c Mon Sep 17 00:00:00 2001 From: Ch3LL Date: Thu, 15 Feb 2018 10:16:41 -0500 Subject: [PATCH 18/28] remove unnecessary variable --- bootstrap-salt.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 491a4db..f4bbd39 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3748,8 +3748,7 @@ install_centos_git_deps() { # install swig and openssl on cent6 if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then - __M2C_DEPS="openssl-devel swig" - __yum_install_noinput ${__M2C_DEPS} || return 1 + __yum_install_noinput openssl-devel swig || return 1 fi if [ -f "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then From c035d83c9ccd7a08d023d71226ca730dc8f42633 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 7 Mar 2018 15:08:31 -0500 Subject: [PATCH 19/28] If installing with -P, install tornado<5.0. Tornado 5.0 is not compatible with Salt at this time. For now, install an older version until Salt is fixed for newer versions of tornado. See https://github.com/saltstack/salt/issues/45790 for more information. Fixes #1202 --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f4bbd39..af1b154 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3117,7 +3117,7 @@ install_debian_8_git_deps() { __PIP_PACKAGES='' if (__check_pip_allowed >/dev/null 2>&1); then - __PIP_PACKAGES='tornado' + __PIP_PACKAGES='tornado<5.0' # Install development environment for building tornado Python module __PACKAGES="${__PACKAGES} build-essential python-dev" @@ -3744,7 +3744,7 @@ install_centos_git_deps() { if [ "${_PY_EXE}" != "" ]; then # If "-x" is defined, install dependencies with pip based on the Python version given. - _PIP_PACKAGES="m2crypto jinja2 msgpack-python pycrypto PyYAML tornado zmq" + _PIP_PACKAGES="m2crypto jinja2 msgpack-python pycrypto PyYAML tornado<5.0 zmq" # install swig and openssl on cent6 if [ "$DISTRO_MAJOR_VERSION" -eq 6 ]; then From 0c4b68db402a403e3e0d640bc31900e5ab0b8ce7 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 7 Mar 2018 15:28:40 -0500 Subject: [PATCH 20/28] Add 2018.3 branch to list of stable options --- bootstrap-salt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f4bbd39..358df4e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -9,7 +9,7 @@ # # BUGS: https://github.com/saltstack/salt-bootstrap/issues # -# COPYRIGHT: (c) 2012-2017 by the SaltStack Team, see AUTHORS.rst for more +# COPYRIGHT: (c) 2012-2018 by the SaltStack Team, see AUTHORS.rst for more # details. # # LICENSE: Apache 2.0 @@ -593,14 +593,14 @@ elif [ "$ITYPE" = "stable" ]; then if [ "$#" -eq 0 ];then STABLE_REV="latest" else - if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8|2016\.3|2016\.11|2017\.7)$')" != "" ]; then + if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8|2016\.3|2016\.11|2017\.7|2018\.3)$')" != "" ]; then STABLE_REV="$1" shift elif [ "$(echo "$1" | egrep '^([0-9]*\.[0-9]*\.[0-9]*)$')" != "" ]; then STABLE_REV="archive/$1" 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, latest, \$MAJOR.\$MINOR.\$PATCH)" + 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, latest, \$MAJOR.\$MINOR.\$PATCH)" exit 1 fi fi From e2c0433ffa7d1540347659b07ded0d3d5473a398 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Fri, 26 May 2017 16:49:43 +0200 Subject: [PATCH 21/28] Use integer parameter for sleep command The bootstrap-salt.sh script uses a "bashism" for the sleep command. Bash allows real numbers as sleep time, but other POSIX shell interpreters only support an integer as parameter. Thus raise the sleep timeout from 0.1 to 1 second. The git commits baa54a64, acbd9842, 1aea3037, and 03186a6d that introduce the sleep commands do not explain why a sleep command is used in the code. You might be able to remove the sleep command completely. Bug-Debian: https://bugs.debian.org/772406 --- bootstrap-salt.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index bd8ffe1..6eb76d9 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2824,7 +2824,7 @@ install_ubuntu_stable_post() { /bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && /bin/systemctl enable salt-$fname.service > /dev/null 2>&1 ) - sleep 0.1 + sleep 1 /bin/systemctl daemon-reload elif [ -f /etc/init.d/salt-$fname ]; then update-rc.d salt-$fname defaults @@ -2850,7 +2850,7 @@ install_ubuntu_git_post() { [ $fname = "api" ] && continue systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) - sleep 0.1 + sleep 1 systemctl daemon-reload elif [ -f /sbin/initctl ]; then _upstart_conf="/etc/init/salt-$fname.conf" @@ -3433,7 +3433,7 @@ install_fedora_stable_post() { [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) - sleep 0.1 + sleep 1 systemctl daemon-reload done } @@ -3494,7 +3494,7 @@ install_fedora_git_post() { [ $fname = "api" ] && continue systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) - sleep 0.1 + sleep 1 systemctl daemon-reload done } @@ -4762,7 +4762,7 @@ install_arch_linux_post() { /usr/bin/systemctl preset salt-$fname.service > /dev/null 2>&1 && /usr/bin/systemctl enable salt-$fname.service > /dev/null 2>&1 ) - sleep 0.1 + sleep 1 /usr/bin/systemctl daemon-reload continue fi @@ -4790,7 +4790,7 @@ install_arch_linux_git_post() { /usr/bin/systemctl preset salt-${fname}.service > /dev/null 2>&1 && /usr/bin/systemctl enable salt-${fname}.service > /dev/null 2>&1 ) - sleep 0.1 + sleep 1 /usr/bin/systemctl daemon-reload continue fi @@ -5635,7 +5635,7 @@ install_opensuse_stable_post() { if [ -f /bin/systemctl ]; then systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) - sleep 0.1 + sleep 1 systemctl daemon-reload continue fi From 357a07bf7becb851824da6db09116d5916ae56ab Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Tue, 27 Mar 2018 13:24:45 +0300 Subject: [PATCH 22/28] Remove COPR repos configuration for Fedora --- bootstrap-salt.sh | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 6eb76d9..8585346 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -249,7 +249,6 @@ _CURL_ARGS=${BS_CURL_ARGS:-} _FETCH_ARGS=${BS_FETCH_ARGS:-} _GPG_ARGS=${BS_GPG_ARGS:-} _WGET_ARGS=${BS_WGET_ARGS:-} -_ENABLE_EXTERNAL_ZMQ_REPOS=${BS_ENABLE_EXTERNAL_ZMQ_REPOS:-$BS_FALSE} _SALT_MASTER_ADDRESS=${BS_SALT_MASTER_ADDRESS:-null} _SALT_MINION_ID="null" # _SIMPLIFY_VERSION is mostly used in Solaris based distributions @@ -355,8 +354,6 @@ __usage() { per -p flag. You're responsible for providing the proper package name. -H Use the specified HTTP proxy for all download URLs (including https://). For example: http://myproxy.example.com:3128 - -Z Enable additional package repository for newer ZeroMQ - (only available for RHEL/CentOS/Fedora/Ubuntu based distributions) -b Assume that dependencies are already installed and software sources are set up. If git is selected, git tree is still checked out as dependency step. @@ -438,7 +435,6 @@ do p ) _EXTRA_PACKAGES="$_EXTRA_PACKAGES $OPTARG" ;; d ) _DISABLE_SALT_CHECKS=$BS_TRUE ;; H ) _HTTP_PROXY="$OPTARG" ;; - Z ) _ENABLE_EXTERNAL_ZMQ_REPOS=$BS_TRUE ;; b ) _NO_DEPS=$BS_TRUE ;; f ) _FORCE_SHALLOW_CLONE=$BS_TRUE ;; l ) _DISABLE_SSL=$BS_TRUE ;; @@ -3367,14 +3363,6 @@ install_debian_check_services() { install_fedora_deps() { - if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then - if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then - __install_saltstack_copr_zeromq_repository || return 1 - fi - - __install_saltstack_copr_salt_repository || return 1 - fi - __PACKAGES="libyaml m2crypto PyYAML python-crypto python-jinja2" __PACKAGES="${__PACKAGES} python2-msgpack python2-requests python-zmq" @@ -3561,20 +3549,6 @@ __install_epel_repository() { return 0 } -__install_saltstack_copr_zeromq_repository() { - echoinfo "Installing Zeromq >=4 and PyZMQ>=14 from SaltStack's COPR repository" - if [ ! -s /etc/yum.repos.d/saltstack-zeromq4.repo ]; then - if [ "${DISTRO_NAME_L}" = "fedora" ]; then - __REPOTYPE="${DISTRO_NAME_L}" - else - __REPOTYPE="epel" - fi - __fetch_url /etc/yum.repos.d/saltstack-zeromq4.repo \ - "${HTTP_VAL}://copr.fedorainfracloud.org/coprs/saltstack/zeromq4/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/saltstack-zeromq4-${__REPOTYPE}-${DISTRO_MAJOR_VERSION}.repo" || return 1 - fi - return 0 -} - __install_saltstack_rhel_repository() { if [ "$ITYPE" = "stable" ]; then repo_rev="$STABLE_REV" @@ -3607,26 +3581,6 @@ _eof return 0 } -__install_saltstack_copr_salt_repository() { - echoinfo "Adding SaltStack's COPR repository" - - if [ "${DISTRO_NAME_L}" = "fedora" ]; then - [ "$DISTRO_MAJOR_VERSION" -ge 22 ] && return 0 - __REPOTYPE="${DISTRO_NAME_L}" - else - __REPOTYPE="epel" - fi - - __REPO_FILENAME="saltstack-salt-${__REPOTYPE}-${DISTRO_MAJOR_VERSION}.repo" - - if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then - __fetch_url "/etc/yum.repos.d/${__REPO_FILENAME}" \ - "${HTTP_VAL}://copr.fedorainfracloud.org/coprs/saltstack/salt/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/${__REPO_FILENAME}" || return 1 - fi - - return 0 -} - install_centos_stable_deps() { if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 From 97d8ba7a55cfa4f6746c95aa9ea4652ef68bbdb5 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Tue, 27 Mar 2018 13:25:44 +0300 Subject: [PATCH 23/28] README: latest stable is in Fedora 26/27/28 repos Also trim some trailing spaces and long lines. --- README.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 9fded74..ae5ca3f 100644 --- a/README.rst +++ b/README.rst @@ -23,8 +23,8 @@ that, please read the generated help by passing ``-h`` to the script or even bet Bootstrap ========= -In every two-step installation example, you would be well-served to **verify against the SHA256 sum** -of the downloaded ``bootstrap-salt.sh`` file. +In every two-step installation example, you would be well-served to **verify against the SHA256 +sum** of the downloaded ``bootstrap-salt.sh`` file. The SHA256 sum of the ``bootstrap-salt.sh`` file, per release, is: @@ -233,8 +233,8 @@ Debian and derivatives - Cumulus Linux 2/3 - Debian GNU/Linux 7/8/9 - Devuan GNU/Linux 1/2 -- Linux Mint Debian Edition 1 (based on Debian 8) - Kali Linux 1.0 (based on Debian 7) +- Linux Mint Debian Edition 1 (based on Debian 8) - Raspbian 8 (``armhf`` packages) and 9 (using ``git`` installation mode only) Debian Best Effort Support: Testing Release @@ -256,7 +256,7 @@ Red Hat family - Amazon Linux 2012.3 and later - CentOS 6/7 - Cloud Linux 6/7 -- Fedora 26/27 +- Fedora 26/27/28 (install latest stable from standard repositories) - Oracle Linux 6/7 - Red Hat Enterprise Linux 6/7 - Scientific Linux 6/7 @@ -277,10 +277,10 @@ Ubuntu and derivatives - Linux Mint 17/18 - Ubuntu 14.04/16.04 and subsequent non-TLS releases (see below) -Ubuntu Best Effort Support: Non-LTS Releases +Ubuntu Best Effort Support: Non-LTS Releases ******************************************** -This script provides best-effort support for current, non-LTS Ubuntu releases. If package +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. @@ -368,8 +368,8 @@ Salt is ready and working in the Docker container with the Minion authenticated **NOTE** -The ``Dockerfile`` here inherits the Ubuntu 14.04 public image with Upstart configured as the init system. -Use it as an example or starting point of how to make your own Docker images with suitable +The ``Dockerfile`` here inherits the Ubuntu 14.04 public image with Upstart configured as the init +system. Use it as an example or starting point of how to make your own Docker images with suitable Salt components, custom configurations, and even `pre-accepted Minion keys`_ already installed. .. _Contributing Guidelines: https://github.com/saltstack/salt-bootstrap/blob/develop/CONTRIBUTING.md From 15250b8ee3438c91ae8acda6d50fb571e99f4a63 Mon Sep 17 00:00:00 2001 From: abednarik Date: Thu, 19 Apr 2018 14:38:14 -0300 Subject: [PATCH 24/28] Install py-tornado4 for FreeBSD. See https://github.com/saltstack/salt/issues/45790 --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8585346..7dee27f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4946,7 +4946,7 @@ install_freebsd_git_deps() { # We're on the develop branch, install whichever tornado is on the requirements file __REQUIRED_TORNADO="$(grep tornado "${_SALT_GIT_CHECKOUT_DIR}/requirements/base.txt")" if [ "${__REQUIRED_TORNADO}" != "" ]; then - /usr/local/sbin/pkg install -y www/py-tornado || return 1 + /usr/local/sbin/pkg install -y www/py-tornado4 || return 1 fi fi From 550ae3e1c0cbee575e1b76a53b05cc24a50f5ff4 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 24 Apr 2018 15:06:50 -0400 Subject: [PATCH 25/28] Update authors file with new contributors --- AUTHORS.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 98e1618..02bd0e6 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -21,6 +21,7 @@ Angelo Gründler plueschopath angelo.gruendler@w1r3.net Ari Aosved devaos ari.aosved@gmail.com Ashok Raja R ashokrajar ashokrajar@users.noreply.github.com Beau Hargis beaucephus beau@customermobile.com +Benjamin Drung bdrung bdrung@debian.org BlaineAtAffirmOnceMore BlaineAtAffirm Boris Feld Lothiraldan Brad Thurber bradthurber @@ -70,6 +71,7 @@ Henrik Holmboe holmboe Howard Mei HowardMei howardleomei@gmail.com James Booth absolutejam vvalentine1337@gmail.com Jared E Stroud jaredestroud jaredestroud@gmail.com +Jasper Lievisse Adriaanse jasperla jasper@humppa.nl JD decomposite Jeff Hui jeffh jeff@jeffhui.net Jeff Strunk jstrunk @@ -112,6 +114,7 @@ Pedro Paulo pedropaulovc Pete Lumbis plumbis Peter Tripp notpeter Petr Michalec epcim +pjcreath pjcreath Prayag Verma pra85 prayag.verma@gmail.com ptonelli ptonelli Randy Thompson beardedeagle randy@heroictek.com @@ -131,6 +134,7 @@ Shawn Butts shawnbutts Skyler Berg skylerberg skylertheberg@gmail.com Stanislav B stanislavb Steve Groesz wolfpackmars2 wolfpackmars2@yahoo.com +sybix sybix Tate Eskew tateeskew Thomas S. Hatch thatch45 thatch45@saltstack.com Tobias Jungel toanju Tobias.Jungel@gmail.com From 6b49d129d1a4a1afe4d3b237bc3d811d14d8adb1 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 24 Apr 2018 15:07:10 -0400 Subject: [PATCH 26/28] Update changelog with latest changes --- ChangeLog | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index f5618a6..65a274f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +Version 2018.04.24: + * Install py-tornado4 for FreeBSD. (abednarik) #1219 + * Remove COPR repos configuration for Fedora (vutny ) #1211 + * Fix for silently ignored version argument on CentOS/RHEL (pjcreath) #1210 + * Use integer parameter for sleep command (bdrung) #1205 + * Add 2018.3 branch to list of stable options (rallytime) #1204 + * If installing with -P, install tornado<5.0. (rallytime) #1203 + * Add M2Crypto to python27 centos 6 bootstrap install (Ch3LL) #1201 + * Update README to include mention of bootstrap-salt.ps1 for Windows (rallytime) #1200 + * Port spelling fixes from change in Salt to Bootstrap (rallytime) #1199 + * Add M2Crypto package back to git install functions (rallytime) #1198 + * OpenBSD has a cdn which handles selecting the best mirror (jasperla) #1197 + * Change gnupg2 pacakge to gnupg for non-LTS versions of Ubuntu (rallytime) #1196 + * Install swig30 as freebsd dep instead of swig. (abednarik) #1191 + * make salt-syndic optional on salt bootstrap (sybix) #1190 + * Add __wait_for_apt function: avoid locking on the apt-get process (rallytime) #1186 + * Update the README.rst file with some grammatical changes (rallytime) #1185 + * Update Fedora support: 25 is EOL, 27 is supported (rallytime) #1184 + * Add a note about the use of sudo when running commands to README (rallytime) #1183 + * Adding support for minor release pinning on AWS Linux (cmclaughlin) #1182 + * Wait for zypper processes to finish before calling zypper again (rallytime) #1181 + * only install ca-certificates on opensuse if it isn't already installed (gtmanfred) #1179 + Version 2017.12.13: * Use HTTPS URL for OpenSuse's saltstack repo (gdm85) #1174 * Respect disable repos (-r) option on OpenBSD (eradman) #1171 From af8e97183e8da5b27e0cdab17c713bb36e4f84f5 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 24 Apr 2018 15:08:45 -0400 Subject: [PATCH 27/28] Update release version in bootstrap-salt script --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7dee27f..a5d9fd0 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -18,7 +18,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2017.12.13" +__ScriptVersion="2018.04.24" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0" From cded5c2a07d0c87e9322f6fdfcc6e144c0f633c0 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 25 Apr 2018 15:29:40 -0400 Subject: [PATCH 28/28] Update release date to 4-25 --- ChangeLog | 2 +- bootstrap-salt.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65a274f..a396058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Version 2018.04.24: +Version 2018.04.25: * Install py-tornado4 for FreeBSD. (abednarik) #1219 * Remove COPR repos configuration for Fedora (vutny ) #1211 * Fix for silently ignored version argument on CentOS/RHEL (pjcreath) #1210 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a5d9fd0..056a256 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -18,7 +18,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2018.04.24" +__ScriptVersion="2018.04.25" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0"