From 00492df5f35740f20c974a56b8408d9148380017 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 24 Oct 2016 10:50:42 -0600 Subject: [PATCH 01/35] Add yum-utils package to be installed on Amazon Linux Fixes #974 --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a747021..b568ae8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4120,7 +4120,7 @@ _eof fi fi - __PACKAGES="PyYAML python-crypto python-msgpack python-zmq python26-ordereddict python-jinja2 python-requests" + __PACKAGES="PyYAML python-crypto python-msgpack python-zmq python26-ordereddict python-jinja2 python-requests yum-utils" # shellcheck disable=SC2086 yum -y install ${__PACKAGES} ${ENABLE_EPEL_CMD} || return 1 From 5bc9fdb3f8a1328fa13a23dbaa289f62a9fc9473 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 24 Oct 2016 12:58:21 -0600 Subject: [PATCH 02/35] Install yum-utils before doing anything else in Amazon Linux --- bootstrap-salt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index b568ae8..82c338e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4089,6 +4089,10 @@ install_scientific_linux_check_services() { 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="" if [ $_DISABLE_REPOS -eq $BS_TRUE ]; then ENABLE_EPEL_CMD="--enablerepo=${_EPEL_REPO}" @@ -4120,7 +4124,7 @@ _eof fi fi - __PACKAGES="PyYAML python-crypto python-msgpack python-zmq python26-ordereddict python-jinja2 python-requests yum-utils" + __PACKAGES="PyYAML python-crypto python-msgpack python-zmq python26-ordereddict python-jinja2 python-requests" # shellcheck disable=SC2086 yum -y install ${__PACKAGES} ${ENABLE_EPEL_CMD} || return 1 From 7dede318d5e82e3fb9937b521213d939ce807185 Mon Sep 17 00:00:00 2001 From: Mike Place Date: Thu, 27 Oct 2016 11:59:45 +0900 Subject: [PATCH 03/35] Apply the insecure flag to git as well --- bootstrap-salt.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7bb9dd5..da8f78c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1561,6 +1561,10 @@ __yum_install_noinput() { __git_clone_and_checkout() { 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="${__SALT_GIT_CHECKOUT_PARENT_DIR:-/tmp/git}" From 71cc2cfa2d098632cad53cca49b5d95385bc04d6 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 14 Nov 2016 15:24:04 -0700 Subject: [PATCH 04/35] Add CloudLinux support --- bootstrap-salt.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index da8f78c..ed10230 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -924,6 +924,8 @@ __gather_linux_system_info() { DISTRO_NAME=$(lsb_release -si) if [ "${DISTRO_NAME}" = "Scientific" ]; then DISTRO_NAME="Scientific Linux" + elif [ "$(echo "$DISTRO_NAME" | grep ^CloudLinux)" != "" ]; then + DISTRO_NAME="Cloud Linux" elif [ "$(echo "$DISTRO_NAME" | grep ^RedHat)" != "" ]; then # Let's convert 'CamelCased' to 'Camel Cased' n=$(__camelcase_split "$DISTRO_NAME") @@ -4086,6 +4088,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 From 6f56cbdb4d4d66490811673b28d59fec62fdabfc Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 15 Nov 2016 16:27:48 -0700 Subject: [PATCH 05/35] Make sure cloud linux releasever matches our repo layout --- bootstrap-salt.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ed10230..44f4db5 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1039,6 +1039,9 @@ __gather_linux_system_info() { n="Arch Linux" v="" # Arch Linux does not provide a version. ;; + cloudlinux ) + n="Cloud Linux" + ;; debian ) n="Debian" v=$(__derive_debian_numeric_version "$v") @@ -3455,7 +3458,13 @@ __install_saltstack_rhel_repository() { repo_url="repo.saltstack.com" 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}/" if [ "${DISTRO_MAJOR_VERSION}" -eq 5 ]; then From cda950bd31b57e8b35298517f0316b80bb67c8a1 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Tue, 22 Nov 2016 12:10:02 +0200 Subject: [PATCH 06/35] Configure Salt components after the dependencies installation --- bootstrap-salt.sh | 53 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index da8f78c..7f1ddc9 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -475,7 +475,7 @@ fi # 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 [ "$_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 fi fi @@ -483,7 +483,7 @@ fi # 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 [ "$_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 fi fi @@ -850,7 +850,7 @@ __derive_debian_numeric_version() { # DESCRIPTION: Strip single or double quotes from the provided string. #---------------------------------------------------------------------------------------------------------------------- __unquote_string() { - echo "$*" | sed -e "s/^\([\"']\)\(.*\)\1\$/\2/g" + echo "$*" | sed -e "s/^\([\"\']\)\(.*\)\1\$/\2/g" } #--- FUNCTION ------------------------------------------------------------------------------------------------------- @@ -2311,7 +2311,6 @@ install_ubuntu_deps() { __apt_get_install_noinput python-software-properties || return 1 fi - if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then __enable_universe_repository || return 1 @@ -2353,6 +2352,9 @@ install_ubuntu_deps() { # requests is still used by many salt modules __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 __PACKAGES="${__PACKAGES} procps pciutils" @@ -2759,6 +2761,9 @@ install_debian_deps() { __PACKAGES="procps pciutils" __PIP_PACKAGES="" + # YAML module is used for generating custom master/minion configs + __PACKAGES="${__PACKAGES} python-yaml" + # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -2845,6 +2850,9 @@ install_debian_7_deps() { # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813 __PACKAGES='procps pciutils' + # YAML module is used for generating custom master/minion configs + __PACKAGES="${__PACKAGES} python-yaml" + # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 @@ -2924,9 +2932,8 @@ install_debian_8_deps() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then - __apt_get_upgrade_noinput || return 1 - fi + # YAML module is used for generating custom master/minion configs + __PACKAGES="${__PACKAGES} python-yaml" if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" @@ -3532,14 +3539,23 @@ install_centos_stable_deps() { __PACKAGES="yum-utils chkconfig" - if [ "${_EXTRA_PACKAGES}" != "" ]; then - echoinfo "Also installing the following extra packages as requested: ${_EXTRA_PACKAGES}" - __PACKAGES="${__PACKAGES} ${_EXTRA_PACKAGES}" + # YAML module is used for generating custom master/minion configs + if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then + __PACKAGES="${__PACKAGES} python26-PyYAML" + else + __PACKAGES="${__PACKAGES} PyYAML" fi # shellcheck disable=SC2086 __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 } @@ -3608,10 +3624,10 @@ install_centos_git_deps() { __PACKAGES="" if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then - __PACKAGES="${__PACKAGES} python26-PyYAML python26 python26-requests" - __PACKAGES="${__PACKAGES} python26-crypto python26-jinja2 python26-msgpack python26-tornado python26-zmq" + __PACKAGES="${__PACKAGES} python26 python26-crypto python26-jinja2 python26-msgpack python26-requests" + __PACKAGES="${__PACKAGES} python26-tornado python26-zmq" 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" fi @@ -4242,6 +4258,9 @@ install_arch_linux_stable_deps() { pacman-db-upgrade || return 1 fi + # YAML module is used for generating custom master/minion configs + pacman -Sy --noconfirm --needed python2-yaml + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then pacman -Syyu --noconfirm --needed || return 1 fi @@ -4266,7 +4285,7 @@ install_arch_linux_git_deps() { fi pacman -R --noconfirm python2-distribute 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 __git_clone_and_checkout || return 1 @@ -4519,6 +4538,10 @@ install_freebsd_9_stable_deps() { # shellcheck disable=SC2086 /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 echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -6120,7 +6143,7 @@ for FUNC_NAME in $(__strip_duplicates "$DEP_FUNC_NAMES"); do done 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_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" From e00d3963c630e192ba5fdbc9c1ba77eb12786360 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Wed, 23 Nov 2016 10:33:52 +0200 Subject: [PATCH 07/35] Configure Minion ID and Master address prior to Salt installation --- bootstrap-salt.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7f1ddc9..8fb5c2d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6304,7 +6304,21 @@ if [ "$CONFIG_SALT_FUNC" != "null" ] && [ "$_TEMP_CONFIG_DIR" != "null" ]; then 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 echoinfo "Running ${PRESEED_MASTER_FUNC}()" $PRESEED_MASTER_FUNC @@ -6334,20 +6348,6 @@ if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then 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 if [ "$POST_INSTALL_FUNC" != "null" ] && [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then echoinfo "Running ${POST_INSTALL_FUNC}()" From e5fef4a941c3098ee0789d480db76e0e449390a4 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Thu, 24 Nov 2016 11:44:33 +0200 Subject: [PATCH 08/35] Fix overwriting Minion config from temporarily directory --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index cad13f2..da5d44d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6022,7 +6022,7 @@ config_salt() { # Copy the minions configuration if found # Explicitly check for custom master config to avoid moving the minion config 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 fi From 0697a3206ae2ac5672b65343b3bb79819162352d Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Fri, 25 Nov 2016 11:38:32 +0200 Subject: [PATCH 09/35] Install dependencies if Master/Minion custom configuration specified --- bootstrap-salt.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index da5d44d..cd8120a 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -342,12 +342,12 @@ __usage() { repo.saltstack.com. The option passed with -R replaces the "repo.saltstack.com". If -R is passed, -r is also set. Currently only 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 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 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 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 @@ -6370,6 +6370,16 @@ if [ "$_CUSTOM_MASTER_CONFIG" != "null" ] || [ "$_CUSTOM_MINION_CONFIG" != "null if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="$_SALT_ETC_DIR" 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 # Configure Salt From d6da76e58363e30663dfed35c3012d350d78063a Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Sat, 26 Nov 2016 22:21:22 +0200 Subject: [PATCH 10/35] Correct usage description about "config only" mode --- bootstrap-salt.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index cd8120a..23b38c3 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -309,9 +309,10 @@ __usage() { -F Allow copied files to overwrite existing (config, init.d, etc) -K If set, keep the temporary files in the temporary directories specified with -c and -k - -C Only run the configuration function. This option automatically bypasses - any installation. Implies -F (forced overwrite). To overwrite master or - syndic configs, -M or -S, respectively, must also be specified. + -C Only run the configuration function. Implies -F (forced overwrite). + To overwrite Master or Syndic configs, -M or -S, respectively, must + 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 \${BS_SALT_ETC_DIR}/minion.d/99-master-address.conf -i Pass the salt-minion id. This will be stored under From 02a6911a69fc5dee2396102baa14ac040008ad21 Mon Sep 17 00:00:00 2001 From: rallytime Date: Mon, 28 Nov 2016 14:58:28 -0700 Subject: [PATCH 11/35] Remove FIXME comment and fix systemsmanagement link Fixes #588 --- bootstrap-salt.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 23b38c3..317bd58 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -5133,8 +5133,7 @@ __ZYPPER_REQUIRES_REPLACE_FILES=-1 __set_suse_pkg_repo() { suse_pkg_url_path="${DISTRO_REPO}/systemsmanagement:saltstack.repo" 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 suse_pkg_url_base="${HTTP_VAL}://repo.saltstack.com/opensuse" fi From cc3a2c7021f06e8fc2b522cd7daca37cbc8b8c78 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Tue, 29 Nov 2016 12:36:56 +0200 Subject: [PATCH 12/35] Debian and Ubuntu: install TLS certs before cloning git repo via https --- bootstrap-salt.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 23b38c3..a6b42f0 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2498,7 +2498,15 @@ install_ubuntu_daily_deps() { install_ubuntu_git_deps() { 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 __PACKAGES="" @@ -2955,6 +2963,10 @@ install_debian_git_deps() { __apt_get_install_noinput git || 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 __PACKAGES="libzmq3 libzmq3-dev lsb-release python-apt python-backports.ssl-match-hostname python-crypto" @@ -2992,6 +3004,10 @@ install_debian_8_git_deps() { __apt_get_install_noinput git || 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 __PACKAGES='libzmq3 libzmq3-dev lsb-release python-apt python-crypto python-jinja2 python-msgpack python-requests python-yaml python-zmq' From efff3d46e3e382c7a56b405c07224424092384cc Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Tue, 29 Nov 2016 18:09:48 +0200 Subject: [PATCH 13/35] RPM distros: install TLS certs before cloning git repo via https --- bootstrap-salt.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a6b42f0..b478529 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3301,6 +3301,11 @@ install_fedora_stable_post() { install_fedora_git_deps() { __fedora_get_package_manager + + if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then + $FEDORA_PACKAGE_MANAGER ca-certificates || return 1 + fi + install_fedora_deps || return 1 if ! __check_command_exists git; then @@ -3641,6 +3646,14 @@ install_centos_stable_post() { } 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 if ! __check_command_exists git; then @@ -4248,6 +4261,10 @@ _eof } 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 ENABLE_EPEL_CMD="" @@ -5249,6 +5266,10 @@ install_opensuse_stable_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 if ! __check_command_exists git; then From af4b4aea9374edaa1b4127cf789af20da76d4ac0 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Wed, 30 Nov 2016 14:19:01 +0200 Subject: [PATCH 14/35] Let's detect newly released Salt 2016.11 stable release --- bootstrap-salt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 7d647b5..ce8e55d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2321,7 +2321,7 @@ install_ubuntu_deps() { __enable_universe_repository || return 1 # 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 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 @@ -2420,7 +2420,7 @@ install_ubuntu_stable_deps() { fi # 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 if [ "$DISTRO_MAJOR_VERSION" -eq 15 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." @@ -2840,7 +2840,7 @@ install_debian_7_deps() { fi # 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 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" @@ -2922,7 +2922,7 @@ install_debian_8_deps() { fi # 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}" echo "deb $SALTSTACK_DEBIAN_URL jessie main" > "/etc/apt/sources.list.d/saltstack.list" From a7588821f491e0b3636ae25e3dfa10f2fffbb3c7 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 30 Nov 2016 17:49:44 -0700 Subject: [PATCH 15/35] Adjust code examples to use the actual bootstrap-salt.sh file name --- README.rst | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/README.rst b/README.rst index 951f9e0..41b4d78 100644 --- a/README.rst +++ b/README.rst @@ -58,37 +58,37 @@ Using ``curl`` to install latest development version from GitHub: .. code:: console - curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh git develop + curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh git develop If you want to install a specific release version (based on the Git tags): .. code:: console - curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh git v2016.3.2 + curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh git v2016.3.2 To install a specific branch from a Git fork: .. code:: console - curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh -g https://github.com/myuser/salt.git git mybranch + curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + 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: .. code:: console - curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh -M -N git develop + curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh -M -N git develop If your host has Internet access only via HTTP proxy: .. code:: console PROXY='http://user:password@myproxy.example.com:3128' - curl -o bootstrap_salt.sh -L -x "$PROXY" https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh -H "$PROXY" git + curl -o bootstrap-salt.sh -L -x "$PROXY" https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh -H "$PROXY" git Install using wget @@ -98,15 +98,15 @@ Using ``wget`` to install your distribution's stable packages: .. code:: console - wget -O bootstrap_salt.sh https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh + wget -O bootstrap-salt.sh https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh Installing a specific version from git using ``wget``: .. code:: console - wget -O bootstrap_salt.sh https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh -P git v2015.8.11 + wget -O bootstrap-salt.sh https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh -P git v2015.8.11 .. note:: @@ -121,15 +121,15 @@ If you already have Python installed, ``python 2.6``, then it's as easy as: .. code:: console - python -m urllib "https://bootstrap.saltstack.com" > bootstrap_salt.sh - sudo sh bootstrap_salt.sh git develop + python -m urllib "https://bootstrap.saltstack.com" > bootstrap-salt.sh + sudo sh bootstrap-salt.sh git develop All Python versions should support the following in-line code: .. code:: console - python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > bootstrap_salt.sh - sudo sh bootstrap_salt.sh git develop + python -c 'import urllib; print urllib.urlopen("https://bootstrap.saltstack.com").read()' > bootstrap-salt.sh + sudo sh bootstrap-salt.sh git develop Install using fetch @@ -140,8 +140,8 @@ have ``fetch`` available though: .. code:: console - fetch -o bootstrap_salt.sh https://bootstrap.saltstack.com - sudo sh bootstrap_salt.sh + fetch -o bootstrap-salt.sh https://bootstrap.saltstack.com + sudo sh bootstrap-salt.sh If you have any SSL issues install ``ca_root_nssp``: @@ -479,8 +479,8 @@ version. .. code:: console - curl -o bootstrap_salt.sh -L https://bootstrap.saltstack.com/develop - sudo sh bootstrap_salt.sh git develop + curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com/develop + sudo sh bootstrap-salt.sh git develop Or the insecure one liner: From 2bbeb079a9fe68d10632719639f79f590d674595 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Fri, 9 Dec 2016 17:57:08 +0200 Subject: [PATCH 16/35] Drop unnecessary workarounds (creating directories) for early releases --- bootstrap-salt.sh | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ce8e55d..7531fb3 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -6150,9 +6150,6 @@ config_salt() { exit 0 fi - # Create default logs directory if not exists - mkdir -p /var/log/salt - return 0 } # @@ -6464,15 +6461,6 @@ if [ "$_CONFIG_ONLY" -eq $BS_FALSE ]; then 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 - # 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 echoinfo "Running ${POST_INSTALL_FUNC}()" From 155cfc5574025526bc7b5d4927362c52e7814798 Mon Sep 17 00:00:00 2001 From: Alexey Dmitriev Date: Wed, 14 Dec 2016 18:04:02 +0100 Subject: [PATCH 17/35] fix systemctl path --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ce8e55d..f03f3bd 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3627,7 +3627,7 @@ install_centos_stable_post() { [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue 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 enable salt-${fname}.service > /dev/null 2>&1 ) From 3f9f53aff37e4db669c5e488c84b40b44ec7bc10 Mon Sep 17 00:00:00 2001 From: Marco Molteni Date: Sat, 17 Dec 2016 21:42:49 +0100 Subject: [PATCH 18/35] Handle renaming of gnupg-curl to gnupg1-curl for Ubuntu 16.10 --- bootstrap-salt.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ce8e55d..2c61cba 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1459,6 +1459,15 @@ if ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ $_PIP_ALL -eq $BS_TRUE ]);then exit 1 fi +# Hack proof of concept. Feel free to refactor properly. +# Starting from Ubuntu 16.01, 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 ------------------------------------------------------------------------------------------------------- # NAME: __function_defined # DESCRIPTION: Checks if a function is defined within this scripts scope @@ -1503,7 +1512,7 @@ __apt_get_upgrade_noinput() { __apt_key_fetch() { url=$1 - __apt_get_install_noinput gnupg-curl || return 1 + __apt_get_install_noinput ${GNUPG_CURL} || return 1 # shellcheck disable=SC2086 apt-key adv ${_GPG_ARGS} --fetch-keys "$url"; return $? From 13919948be3b05bd6d3632d5cbb0b378c29fdba1 Mon Sep 17 00:00:00 2001 From: Marco Molteni Date: Sun, 18 Dec 2016 14:28:53 +0100 Subject: [PATCH 19/35] Add missing double quotes --- bootstrap-salt.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2c61cba..dfeccea 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1459,10 +1459,9 @@ if ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ $_PIP_ALL -eq $BS_TRUE ]);then exit 1 fi -# Hack proof of concept. Feel free to refactor properly. -# Starting from Ubuntu 16.01, gnupg-curl has been renamed to gnupg1-curl. +# 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 +if ([ "${DISTRO_NAME_L}" = "ubuntu" ] && [ "${DISTRO_VERSION}" = "16.10" ]); then GNUPG_CURL="gnupg1-curl" fi From 95693446321bf25fcb05208c3d2156743e7d8308 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 20 Dec 2016 16:56:47 -0700 Subject: [PATCH 20/35] Update supported versions for Fedora: 23, 24, and 25. The bootstrap script should match the supported versions of SaltStack more closely, and we don't support versions that are considered EOL by the OS distributors themselves. This change updates the bootstrap script to support Fedora 23, 24, and 25. Since "dnf" replaced "yum" as the package provider in Fedora 23, we no longer need to set the $FEDORA_PACKAGE_MANAGER variable based on the version of Fedora. This can simply be "dnf" now for Fedora installs. --- README.rst | 4 ++-- bootstrap-salt.sh | 35 +++++++++-------------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/README.rst b/README.rst index 41b4d78..5083d16 100644 --- a/README.rst +++ b/README.rst @@ -200,7 +200,7 @@ Supported Operating Systems .. note:: 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 `Adding Support for Other Operating Systems`_ sections. @@ -231,7 +231,7 @@ Red Hat family - Amazon Linux 2012.09/2013.03/2013.09/2014.03/2014.09 - CentOS 5/6/7 -- Fedora 17/18/20/21/22 +- Fedora 23/24/25 - Oracle Linux 5/6/7 - Red Hat Enterprise Linux 5/6/7 - Scientific Linux 5/6/7 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 696c8f7..8152c3f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1744,7 +1744,7 @@ __check_end_of_life_versions() { fedora) # 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 "Please consider upgrading to the next stable. See:" echoerror " https://fedoraproject.org/wiki/Releases" @@ -3225,16 +3225,7 @@ install_debian_check_services() { # 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() { - __fedora_get_package_manager if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then @@ -3244,32 +3235,25 @@ install_fedora_deps() { __install_saltstack_copr_salt_repository || return 1 fi - __PACKAGES="yum-utils PyYAML libyaml python-crypto python-jinja2 python-zmq" - - if [ "$DISTRO_MAJOR_VERSION" -ge 23 ]; then - __PACKAGES="${__PACKAGES} python2-msgpack python2-requests" - else - __PACKAGES="${__PACKAGES} python-msgpack python-requests" - fi + __PACKAGES="yum-utils PyYAML libyaml python-crypto python-jinja2 python-zmq python2-msgpack python2-requests" # shellcheck disable=SC2086 - $FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 + dnf install -y ${__PACKAGES} || return 1 if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then - $FEDORA_PACKAGE_MANAGER -y update || return 1 + dnf -y update || return 1 fi if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - $FEDORA_PACKAGE_MANAGER install -y ${_EXTRA_PACKAGES} || return 1 + dnf install -y ${_EXTRA_PACKAGES} || return 1 fi return 0 } install_fedora_stable() { - __fedora_get_package_manager __PACKAGES="" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ];then @@ -3286,7 +3270,7 @@ install_fedora_stable() { fi # shellcheck disable=SC2086 - $FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 + dnf install -y ${__PACKAGES} || return 1 return 0 } @@ -3308,16 +3292,15 @@ install_fedora_stable_post() { } install_fedora_git_deps() { - __fedora_get_package_manager if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - $FEDORA_PACKAGE_MANAGER ca-certificates || return 1 + dnf ca-certificates || return 1 fi install_fedora_deps || return 1 if ! __check_command_exists git; then - $FEDORA_PACKAGE_MANAGER install -y git || return 1 + dnf install -y git || return 1 fi __git_clone_and_checkout || return 1 @@ -3345,7 +3328,7 @@ install_fedora_git_deps() { fi # shellcheck disable=SC2086 - $FEDORA_PACKAGE_MANAGER install -y ${__PACKAGES} || return 1 + dnf install -y ${__PACKAGES} || return 1 if [ "${__PIP_PACKAGES}" != "" ]; then # shellcheck disable=SC2086,SC2090 From 3bc694ef348ed3c26b5f5829c3aeb5da472fe05f Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 09:02:50 -0700 Subject: [PATCH 21/35] Add "install -y" in dnf cmd and update spacing --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8152c3f..8edfacf 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3294,13 +3294,13 @@ install_fedora_stable_post() { install_fedora_git_deps() { if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then - dnf ca-certificates || return 1 + dnf install -y ca-certificates || return 1 fi install_fedora_deps || return 1 if ! __check_command_exists git; then - dnf install -y git || return 1 + dnf install -y git || return 1 fi __git_clone_and_checkout || return 1 From 75b3eb32b8cfd62a24a4a8ec7afef27499f1c538 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 10:20:03 -0700 Subject: [PATCH 22/35] Updated supported versions for Ubuntu: 12.04, 14.04, 16.04, and 16.10 (best effort) The bootstrap script should match the supported versions of SaltStack more closely, and we don't support versions that are considered EOL by the OS distributors themselves. This change updates the bootstrap script to support Ubuntu 12.04, 14.04, 16.04, and 16.10 (which the .10 release is a "best-effort" support since it is a non-LTS OS release from Ubuntu). --- README.rst | 2 +- bootstrap-salt.sh | 75 ++++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 51 deletions(-) diff --git a/README.rst b/README.rst index 41b4d78..c31058e 100644 --- a/README.rst +++ b/README.rst @@ -253,7 +253,7 @@ Ubuntu and derivatives - Linaro 12.04 - Linux Mint 13/14/16/17/18 - 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 Other Linux distro diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 696c8f7..23b87df 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1707,7 +1707,12 @@ __check_end_of_life_versions() { # Ubuntu versions not supported # # < 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 "Please consider upgrading to the next stable. See:" echoerror " https://wiki.ubuntu.com/Releases" @@ -2303,13 +2308,8 @@ __enable_universe_repository() { echodebug "Enabling the universe repository" # Ubuntu versions higher than 12.04 do not live in the old repositories - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then + if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; 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 @@ -2318,7 +2318,7 @@ __enable_universe_repository() { } 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 __apt_get_install_noinput software-properties-common || return 1 else @@ -2332,18 +2332,10 @@ install_ubuntu_deps() { if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" = "" ]; then if [ "$DISTRO_MAJOR_VERSION" -lt 14 ]; then 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 - # Above Ubuntu 11.04 add a -y flag - add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 - add-apt-repository -y "ppa:chris-lea/python-chardet" || 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 + add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 + add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1 + add-apt-repository -y "ppa:chris-lea/python-urllib3" || return 1 + add-apt-repository -y "ppa:chris-lea/python-crypto" || return 1 fi fi @@ -2354,7 +2346,7 @@ install_ubuntu_deps() { # Minimal systems might not have upstart installed, install it __PACKAGES="upstart" - if [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then __PACKAGES="${__PACKAGES} python2.7" fi if [ "$_VIRTUALENV_DIR" != "null" ]; then @@ -2385,7 +2377,7 @@ install_ubuntu_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 echodebug "On Ubuntu systems we increase the default sleep value to 10." echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." @@ -2430,10 +2422,10 @@ install_ubuntu_stable_deps() { # 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|2016\.11|latest|archive\/)')" != "" ]; then # Workaround for latest non-LTS ubuntu - if [ "$DISTRO_MAJOR_VERSION" -eq 15 ]; then + if [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." - UBUNTU_VERSION=14.04 - UBUNTU_CODENAME=trusty + UBUNTU_VERSION=16.04 + UBUNTU_CODENAME=xenial else UBUNTU_VERSION=$DISTRO_VERSION UBUNTU_CODENAME=$DISTRO_CODENAME @@ -2459,12 +2451,7 @@ install_ubuntu_stable_deps() { STABLE_PPA="saltstack/salt" fi - 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:$STABLE_PPA" || return 1 - else - add-apt-repository "ppa:$STABLE_PPA" || return 1 - fi + add-apt-repository -y "ppa:$STABLE_PPA" || return 1 fi apt-get update @@ -2476,24 +2463,12 @@ install_ubuntu_stable_deps() { install_ubuntu_daily_deps() { install_ubuntu_stable_deps || return 1 - if [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then - # Above Ubuntu 11.10 add-apt-repository is in a different package - __apt_get_install_noinput software-properties-common || return 1 - else - __apt_get_install_noinput python-software-properties || return 1 - fi + __apt_get_install_noinput software-properties-common || return 1 if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then __enable_universe_repository || return 1 - # for anything up to and including 11.04 do not use the -y option - 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 - + add-apt-repository -y ppa:saltstack/salt-daily || return 1 apt-get update fi @@ -2599,7 +2574,7 @@ install_ubuntu_git() { 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 + if [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then return 0 fi @@ -2635,7 +2610,7 @@ install_ubuntu_git_post() { [ $fname = "minion" ] && [ "$_INSTALL_MINION" -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" # Skip salt-api since the service should be opt-in and not necessarily started on boot @@ -2680,7 +2655,7 @@ install_ubuntu_restart_daemons() { [ $_START_DAEMONS -eq $BS_FALSE ] && return # 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 elif [ -f /sbin/initctl ]; then /sbin/initctl reload-configuration @@ -2695,7 +2670,7 @@ install_ubuntu_restart_daemons() { [ $fname = "minion" ] && [ "$_INSTALL_MINION" -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" systemctl stop salt-$fname > /dev/null 2>&1 systemctl start salt-$fname.service @@ -2739,7 +2714,7 @@ install_ubuntu_check_services() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -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 elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then __check_services_upstart salt-$fname || return 1 From 22a9a7c3843c53b066a884eff3732194edd3bef9 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 10:26:08 -0700 Subject: [PATCH 23/35] Remove linuxmint derivative mappings for EOL ubuntu OSes --- bootstrap-salt.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 23b87df..46b0a76 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1201,12 +1201,6 @@ __ubuntu_derivatives_translation() { # Mappings trisquel_6_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_18_ubuntu_base="16.04" linaro_12_ubuntu_base="12.04" From 5d455801318973decf7fc86cd2d8867c525e9027 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 11:00:49 -0700 Subject: [PATCH 24/35] Add "yakkety" to ubuntu_codename_translation function Follow up to #998 and #976 This change will make it so the xenial repo.saltstack.com is not added in `/etc/apt/sources.list.d/saltstack.list` file, but is instead added as yakkety. The 16.10 link to repo.saltstack.com currently will throw 404 errors, but the install will succeed by installing 2016.3.1 from Ubuntu's repo. Git installs will work. It's possible that a 16.10 repo will be added in the future. When that happens, the bootstrap script will be ready. --- bootstrap-salt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 696c8f7..e2f0d9d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1272,7 +1272,11 @@ __ubuntu_codename_translation() { fi ;; "16") - DISTRO_CODENAME="xenial" + if [ "$_april" ]; then + DISTRO_CODENAME="xenial" + else + DISTRO_CODENAME="yakkety" + fi ;; *) DISTRO_CODENAME="trusty" From c80e8e6caebc7448c5117c058b9975d75521291c Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 11:19:18 -0700 Subject: [PATCH 25/35] Remove Ubuntu 15 from ubuntu_codename_translation function --- bootstrap-salt.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 46b0a76..65f69ac 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1258,13 +1258,6 @@ __ubuntu_codename_translation() { "14") DISTRO_CODENAME="trusty" ;; - "15") - if [ -n "$_april" ]; then - DISTRO_CODENAME="vivid" - else - DISTRO_CODENAME="wily" - fi - ;; "16") DISTRO_CODENAME="xenial" ;; From 37ee8cd46ab122ebe435f56f9cc08441f50d7fd8 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 15:13:18 -0700 Subject: [PATCH 26/35] Add python-systemd package to debian 8 git install Fixes #999 --- bootstrap-salt.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 696c8f7..5b0c7e1 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2978,7 +2978,7 @@ 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 python-tornado" + __PACKAGES="${__PACKAGES} python-jinja2 python-msgpack python-requests" __PACKAGES="${__PACKAGES} python-tornado python-yaml python-zmq" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then @@ -3018,7 +3018,8 @@ 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 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 # Install python-libcloud if asked to From 2e49173293e5e73dfc6f68b7f749a0ea1a4a89c9 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 22 Dec 2016 10:13:01 -0700 Subject: [PATCH 27/35] Various fixes from PR review: - Update Linux Mint supported versions in README file - Remove if statement restricting archive.ubuntu.com repository addition - Remove old-releases.ubuntu.com repository addition - Remove some unnecessary parens in an if statement && clause - Add the python-software-properties install logic back in for Ubutu 12 - Remove the workaround for starting deamons for older versions (no longer applicable) - Fix architecture spelling in README file --- README.rst | 6 +++--- bootstrap-salt.sh | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index c31058e..93e2f3b 100644 --- a/README.rst +++ b/README.rst @@ -216,8 +216,8 @@ Debian and derivatives .. note:: 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`` - bootstrap mode as described above to install Salt on other architechtures, such as ``i386`` or + is currently supported for ``amd64`` (``x86-64``) and ``armhf`` architectures ONLY. Use ``git`` + 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 by providing ``-r`` and ``-P`` options to the bootstrap script, i.e.: @@ -251,7 +251,7 @@ Ubuntu and derivatives - Elementary OS 0.2 (based on Ubuntu 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) - Ubuntu 12.04/14.04/16.04 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 65f69ac..ea2cd48 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2294,12 +2294,7 @@ __enable_universe_repository() { echodebug "Enabling the universe repository" - # Ubuntu versions higher than 12.04 do not live in the old repositories - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then - add-apt-repository -y "deb http://archive.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 + add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 return 0 } @@ -2364,7 +2359,7 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - if ([ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]); 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 echodebug "On Ubuntu systems we increase the default sleep value to 10." echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." @@ -2450,7 +2445,12 @@ install_ubuntu_stable_deps() { install_ubuntu_daily_deps() { install_ubuntu_stable_deps || return 1 - __apt_get_install_noinput software-properties-common || return 1 + if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then + __apt_get_install_noinput software-properties-common || return 1 + else + # Ubuntu 12.04 needs python-software-properties to get add-apt-repository binary + __apt_get_install_noinput python-software-properties || return 1 + fi if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then __enable_universe_repository || return 1 @@ -2559,12 +2559,6 @@ install_ubuntu_git() { } 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 16 ]; then - return 0 - fi - for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue From 1765a68f54d379ab7bc609545d7ae338e74c24b1 Mon Sep 17 00:00:00 2001 From: ek9 Date: Sun, 1 Jan 2017 23:03:32 +0100 Subject: [PATCH 28/35] fix bootstrap in Arch Linux by updating package name from salt-zmq to salt #1005 --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e4432e2..cc44770 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4420,7 +4420,7 @@ install_arch_linux_stable() { pacman -S --noconfirm --needed bash || return 1 pacman -Su --noconfirm || return 1 # We can now resume regular salt update - pacman -Syu --noconfirm salt-zmq || return 1 + pacman -Syu --noconfirm salt || return 1 return 0 } From 20d88f2f1fca57c7f0a7e210a07c6ac493eca994 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 4 Jan 2017 09:32:34 -0500 Subject: [PATCH 29/35] Simplify ubuntu version check to look for "16.10" --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ea2cd48..61ee98e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2404,7 +2404,7 @@ install_ubuntu_stable_deps() { # 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|2016\.11|latest|archive\/)')" != "" ]; then # Workaround for latest non-LTS ubuntu - if [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; 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." UBUNTU_VERSION=16.04 UBUNTU_CODENAME=xenial From cb87b7d0bd95b0a73825962c0f6b24670c245b80 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 4 Jan 2017 11:08:04 -0500 Subject: [PATCH 30/35] Add note about best-effort support for non-lts ubuntu releases to README --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index 93e2f3b..9313f4e 100644 --- a/README.rst +++ b/README.rst @@ -255,6 +255,20 @@ Ubuntu and derivatives - Trisquel GNU/Linux 6 (based on Ubuntu 12.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 +[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) 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 +[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) and +install the 16.04 packages. + Other Linux distro ~~~~~~~~~~~~~~~~~~ From 436144ce46dca22bddd42cbcf7682f5a432e7289 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 5 Jan 2017 09:49:11 -0500 Subject: [PATCH 31/35] Use rst syntax and not markdown in README file --- README.rst | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 9313f4e..1e35657 100644 --- a/README.rst +++ b/README.rst @@ -257,17 +257,15 @@ Ubuntu and derivatives 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 -[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) for -the non-LTS release, the bootstrap script will attempt to -install the packages for the most closely related LTS Ubuntu -release instead. +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 -[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) and -install the 16.04 packages. +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 From e16f24329c3262b1a2d50a864c047f442b341169 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 6 Jan 2017 09:48:25 -0500 Subject: [PATCH 32/35] Make sub-section for non-lts ubuntu releases note --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1e35657..ce9779e 100644 --- a/README.rst +++ b/README.rst @@ -255,7 +255,8 @@ Ubuntu and derivatives - Trisquel GNU/Linux 6 (based on Ubuntu 12.04) - Ubuntu 12.04/14.04/16.04 -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 repositories are not provided on `SaltStack's Ubuntu repository`_ for the non-LTS release, the From 098a74d26e0cba46c76190bc47d1864defca0236 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 10 Jan 2017 12:16:39 -0700 Subject: [PATCH 33/35] Update AUTHORS.rst with new contributors --- AUTHORS.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index b96b08f..fe59f7c 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -12,6 +12,7 @@ Adam Wright hipikat adam@hipikat.org Alec Koumjian akoumjian akoumjian@gmail.com Alex Van't Hof alexvh Alexander Krasnukhin themalkolm the.malkolm@gmail.com +Alexey dmitrievav Angelo Gründler plueschopath angelo.gruendler@w1r3.net Ari Aosved devaos ari.aosved@gmail.com Beau Hargis beaucephus beau@customermobile.com @@ -35,6 +36,7 @@ denmat denmat Denys Havrysh vutny denys.gavrysh@gmail.com deployboy deployboy Diego Woitasen diegows diego@flugel.it +ek9 ek9 Elias Probst eliasp eliezerlp eliezerlp Emiel Kollof ekollof @@ -66,8 +68,9 @@ lomeroe lomeroe Liu Xiaohui oreh herolxh@gmail.com Lubomir Host lhost Marc Vieira-Cardinal marccadinal -Mark Lee malept +Marco Molteni marco-m Marcus Furlong furlongm furlongm@gmail.com +Mark Lee malept markgaylard markgaylard Matt Black mafrosis Matthew Garrett cingeyedog matt@clemson.edu From ca5b3327fa96defc985ee784baa2943c22721fcf Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 10 Jan 2017 14:43:03 -0700 Subject: [PATCH 34/35] Update changelog in preparation for 2017.01.10 release --- ChangeLog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 785189d..7e35cb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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: * Update AUTHORS.rst with new contributors (rallytime) #978 * Let's start detecting the upcoming Debian 9 (Stretch) (lhost) #975 From 33008a06ec2409bb7505ce4578f366b1f92faf74 Mon Sep 17 00:00:00 2001 From: rallytime Date: Tue, 10 Jan 2017 14:43:23 -0700 Subject: [PATCH 35/35] Update script to version 2017.01.10 Also updated copyright date range to 2017 --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9253b80..0cec8ac 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -9,7 +9,7 @@ # # 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. # # LICENSE: Apache 2.0 @@ -18,7 +18,7 @@ #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2016.10.25" +__ScriptVersion="2017.01.10" __ScriptName="bootstrap-salt.sh" __ScriptFullName="$0"