From d2f39d14feaa0f5f1dea808938ddc319575b8d78 Mon Sep 17 00:00:00 2001 From: Roman Inflianskas Date: Sun, 23 Nov 2014 00:59:52 +0300 Subject: [PATCH 01/75] opensuse 13.2: fix installation --- bootstrap-salt.sh | 53 ++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c9a1f78..1f444a2 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -17,7 +17,7 @@ # CREATED: 10/15/2012 09:49:37 PM WEST #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2014.10.30" +__ScriptVersion="2014.11.22" __ScriptName="bootstrap-salt.sh" #====================================================================================================================== @@ -697,6 +697,7 @@ __gather_linux_system_info() { elif [ "${DISTRO_NAME}" = "openSUSE project" ]; then # lsb_release -si returns "openSUSE project" on openSUSE 12.3 DISTRO_NAME="opensuse" + install_opensuse_zypper_vars elif [ "${DISTRO_NAME}" = "SUSE LINUX" ]; then if [ "$(lsb_release -sd | grep -i opensuse)" != "" ]; then # openSUSE 12.2 reports SUSE LINUX on lsb_release -si @@ -705,6 +706,7 @@ __gather_linux_system_info() { # lsb_release -si returns "SUSE LINUX" on SLES 11 SP3 DISTRO_NAME="suse" fi + install_opensuse_zypper_vars elif [ "${DISTRO_NAME}" = "EnterpriseEnterpriseServer" ]; then # This the Oracle Linux Enterprise ID before ORACLE LINUX 5 UPDATE 3 DISTRO_NAME="Oracle Linux" @@ -3937,18 +3939,32 @@ install_smartos_restart_daemons() { # # openSUSE Install Functions. # + +__version_lte() { + [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] +} + +install_opensuse_zypper_vars() { + ZYPPER="zypper --non-interactive " + ZYPPER_INSTALL="$ZYPPER install --auto-agree-with-licenses " + # In case of file conflicts replace old files. + # Option present in zypper 1.10.4 and newer: + # https://github.com/openSUSE/zypper/blob/95655728d26d6d5aef7796b675f4cc69bc0c05c0/package/zypper.changes#L253 + __version_lte 1.10.4 `zypper --version | sed 's/zypper //'` && ZYPPER_INSTALL="$ZYPPER_INSTALL --replacefiles " +} + install_opensuse_stable_deps() { DISTRO_REPO="openSUSE_${DISTRO_MAJOR_VERSION}.${DISTRO_MINOR_VERSION}" # Is the repository already known - zypper repos | grep devel_languages_python >/dev/null 2>&1 + $ZYPPER repos | grep devel_languages_python >/dev/null 2>&1 if [ $? -eq 1 ]; then # zypper does not yet know nothing about devel_languages_python - zypper --non-interactive addrepo --refresh \ + $ZYPPER addrepo --refresh \ "http://download.opensuse.org/repositories/devel:/languages:/python/${DISTRO_REPO}/devel:languages:python.repo" || return 1 fi - zypper --gpg-auto-import-keys --non-interactive refresh + $ZYPPER --gpg-auto-import-keys refresh if [ $? -ne 0 ] && [ $? -ne 4 ]; then # If the exit code is not 0, and it's not 4 (failed to update a # repository) return a failure. Otherwise continue. @@ -3957,11 +3973,11 @@ install_opensuse_stable_deps() { if [ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -eq 3 ]; then # Because patterns-openSUSE-minimal_base-conflicts conflicts with python, lets remove the first one - zypper --non-interactive remove patterns-openSUSE-minimal_base-conflicts + $ZYPPER remove patterns-openSUSE-minimal_base-conflicts fi if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then - zypper --gpg-auto-import-keys --non-interactive update || return 1 + $ZYPPER --gpg-auto-import-keys update || return 1 fi # Salt needs python-zypp installed in order to use the zypper module @@ -3974,12 +3990,12 @@ install_opensuse_stable_deps() { fi # shellcheck disable=SC2086 - zypper --non-interactive install --auto-agree-with-licenses ${__PACKAGES} || return 1 + $ZYPPER_INSTALL ${__PACKAGES} || return 1 if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - zypper --non-interactive install --auto-agree-with-licenses ${_EXTRA_PACKAGES} || return 1 + $ZYPPER_INSTALL ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -3987,7 +4003,7 @@ install_opensuse_stable_deps() { install_opensuse_git_deps() { install_opensuse_stable_deps || return 1 - zypper --non-interactive install --auto-agree-with-licenses git || return 1 + $ZYPPER_INSTALL git || return 1 __git_clone_and_checkout || return 1 @@ -4018,7 +4034,7 @@ install_opensuse_stable() { __PACKAGES="${__PACKAGES} salt-syndic" fi # shellcheck disable=SC2086 - zypper --non-interactive install --auto-agree-with-licenses $__PACKAGES || return 1 + $ZYPPER_INSTALL $__PACKAGES || return 1 return 0 } @@ -4135,17 +4151,17 @@ install_suse_11_stable_deps() { DISTRO_REPO="SLE_${DISTRO_MAJOR_VERSION}${DISTRO_PATCHLEVEL}" # Is the repository already known - zypper repos | grep devel_languages_python >/dev/null 2>&1 + $ZYPPER repos | grep devel_languages_python >/dev/null 2>&1 if [ $? -eq 1 ]; then # zypper does not yet know nothing about devel_languages_python - zypper --non-interactive addrepo --refresh \ + $ZYPPER addrepo --refresh \ "http://download.opensuse.org/repositories/devel:/languages:/python/${DISTRO_REPO}/devel:languages:python.repo" || return 1 fi - zypper --gpg-auto-import-keys --non-interactive refresh || return 1 + $ZYPPER --gpg-auto-import-keys refresh || return 1 if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then - zypper --gpg-auto-import-keys --non-interactive update || return 1 + $ZYPPER --gpg-auto-import-keys update || return 1 fi # Salt needs python-zypp installed in order to use the zypper module @@ -4168,10 +4184,9 @@ install_suse_11_stable_deps() { # 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 --non-interactive install --auto-agree-with-licenses 'python-M2Crypto>=0.22' || \ - zypper --non-interactive install --auto-agree-with-licenses 'python-M2Crypto>=0.21' || return 1 + $ZYPPER_INSTALL 'python-M2Crypto>=0.22' || $ZYPPER_INSTALL 'python-M2Crypto>=0.21' || return 1 # shellcheck disable=SC2086,SC2090 - zypper --non-interactive install --auto-agree-with-licenses ${__PACKAGES} || return 1 + $ZYPPER_INSTALL ${__PACKAGES} || return 1 if [ "$SUSE_PATCHLEVEL" -eq 1 ]; then # There's no python-PyYaml in SP1, let's install it using pip @@ -4210,7 +4225,7 @@ install_suse_11_stable_deps() { if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - zypper --non-interactive install --auto-agree-with-licenses ${_EXTRA_PACKAGES} || return 1 + $ZYPPER_INSTALL ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -4218,7 +4233,7 @@ install_suse_11_stable_deps() { install_suse_11_git_deps() { install_suse_11_stable_deps || return 1 - zypper --non-interactive install --auto-agree-with-licenses git || return 1 + $ZYPPER_INSTALL git || return 1 __git_clone_and_checkout || return 1 From a894d0fc64097db5cb7ab556f932f83c56cd4e3c Mon Sep 17 00:00:00 2001 From: Roman Inflianskas Date: Sun, 23 Nov 2014 01:15:17 +0300 Subject: [PATCH 02/75] opensuse 13.2: fix installation; loading zypper variables correctly --- bootstrap-salt.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1f444a2..99427ae 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -697,7 +697,6 @@ __gather_linux_system_info() { elif [ "${DISTRO_NAME}" = "openSUSE project" ]; then # lsb_release -si returns "openSUSE project" on openSUSE 12.3 DISTRO_NAME="opensuse" - install_opensuse_zypper_vars elif [ "${DISTRO_NAME}" = "SUSE LINUX" ]; then if [ "$(lsb_release -sd | grep -i opensuse)" != "" ]; then # openSUSE 12.2 reports SUSE LINUX on lsb_release -si @@ -706,7 +705,6 @@ __gather_linux_system_info() { # lsb_release -si returns "SUSE LINUX" on SLES 11 SP3 DISTRO_NAME="suse" fi - install_opensuse_zypper_vars elif [ "${DISTRO_NAME}" = "EnterpriseEnterpriseServer" ]; then # This the Oracle Linux Enterprise ID before ORACLE LINUX 5 UPDATE 3 DISTRO_NAME="Oracle Linux" @@ -3954,6 +3952,7 @@ install_opensuse_zypper_vars() { } install_opensuse_stable_deps() { + install_opensuse_zypper_vars DISTRO_REPO="openSUSE_${DISTRO_MAJOR_VERSION}.${DISTRO_MINOR_VERSION}" # Is the repository already known @@ -4002,6 +4001,7 @@ install_opensuse_stable_deps() { } install_opensuse_git_deps() { + install_opensuse_zypper_vars install_opensuse_stable_deps || return 1 $ZYPPER_INSTALL git || return 1 @@ -4023,6 +4023,7 @@ install_opensuse_git_deps() { } install_opensuse_stable() { + install_opensuse_zypper_vars __PACKAGES="" if [ "$_INSTALL_MINION" -eq $BS_TRUE ]; then __PACKAGES="${__PACKAGES} salt-minion" @@ -4144,6 +4145,7 @@ install_opensuse_check_services() { # SuSE Install Functions. # install_suse_11_stable_deps() { + install_opensuse_zypper_vars SUSE_PATCHLEVEL=$(awk '/PATCHLEVEL/ {print $3}' /etc/SuSE-release ) if [ "${SUSE_PATCHLEVEL}" != "" ]; then DISTRO_PATCHLEVEL="_SP${SUSE_PATCHLEVEL}" @@ -4232,6 +4234,7 @@ install_suse_11_stable_deps() { } install_suse_11_git_deps() { + install_opensuse_zypper_vars install_suse_11_stable_deps || return 1 $ZYPPER_INSTALL git || return 1 From 3a8b0a0f526aa9c6138e4e08221d3255217f69be Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Sat, 6 Dec 2014 14:51:07 -0800 Subject: [PATCH 03/75] Better detection for Debian versions Re-uses existing Debian version parsing code when /etc/debian_version is found. Fixes #505. --- bootstrap-salt.sh | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c9a1f78..8c64129 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -612,6 +612,33 @@ __parse_version_string() { } +#--- FUNCTION ------------------------------------------------------------------------------------------------------- +# NAME: __derive_debian_numeric_version +# DESCRIPTION: Derive the numeric version from a Debian version string. +#---------------------------------------------------------------------------------------------------------------------- +__derive_debian_numeric_version() { + NUMERIC_VERSION="" + INPUT_VERSION="$1" + if echo "$INPUT_VERSION" | grep -q '^[0-9]'; then + NUMERIC_VERSION="$INPUT_VERSION" + elif [ -z "$INPUT_VERSION" -a -f "/etc/debian_version" ]; then + INPUT_VERSION="$(cat /etc/debian_version)" + fi + if [ -z "$NUMERIC_VERSION" ]; then + if [ "$INPUT_VERSION" = "wheezy/sid" ]; then + # I've found an EC2 wheezy image which did not tell its version + NUMERIC_VERSION=$(__parse_version_string "7.0") + elif [ "$INPUT_VERSION" = "jessie/sid" ]; then + # Let's start detecting the upcoming Debian 8 (Jessie) + NUMERIC_VERSION=$(__parse_version_string "8.0") + else + echowarn "Unable to parse the Debian Version (codename: '$INPUT_VERSION')" + fi + fi + echo "$NUMERIC_VERSION" +} + + #--- FUNCTION ------------------------------------------------------------------------------------------------------- # NAME: __unquote_string # DESCRIPTION: Strip single or double quotes from the provided string. @@ -743,7 +770,11 @@ __gather_linux_system_info() { n=$(echo "${rsource}" | sed -e 's/[_-]release$//' -e 's/[_-]version$//') shortname=$(echo "${n}" | tr '[:upper:]' '[:lower:]') - rv=$( (grep VERSION "/etc/${rsource}"; cat "/etc/${rsource}") | grep '[0-9]' | sed -e 'q' ) + if [ "$shortname" = "debian" ]; then + rv=$(__derive_debian_numeric_version `cat /etc/${rsource}`) + else + rv=$( (grep VERSION "/etc/${rsource}"; cat "/etc/${rsource}") | grep '[0-9]' | sed -e 'q' ) + fi [ "${rv}" = "" ] && [ "$shortname" != "arch" ] && continue # There's no version information. Continue to next rsource v=$(__parse_version_string "$rv") case $shortname in @@ -795,17 +826,7 @@ __gather_linux_system_info() { ;; debian ) n="Debian" - if [ "${v}" = "" ]; then - if [ "$(cat /etc/debian_version)" = "wheezy/sid" ]; then - # I've found an EC2 wheezy image which did not tell its version - v=$(__parse_version_string "7.0") - elif [ "$(cat /etc/debian_version)" = "jessie/sid" ]; then - # Let's start detecting the upcoming Debian 8 (Jessie) - v=$(__parse_version_string "8.0") - fi - else - echowarn "Unable to parse the Debian Version" - fi + v=$(__derive_debian_numeric_version "$v") ;; * ) n=${nn} From 059c2dc155767750b33f02488aa9e56e345746ec Mon Sep 17 00:00:00 2001 From: Peter Tripp Date: Thu, 12 Mar 2015 04:00:24 -0700 Subject: [PATCH 04/75] Trailing whitespace is evil. --- bootstrap-salt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3abbc84..00daf99 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2073,7 +2073,7 @@ _eof if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 - __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 + __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 fi return 0 @@ -2632,11 +2632,11 @@ install_centos_stable() { fi if [ "$_INSTALL_MASTER" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-master" - fi + fi if [ "$_INSTALL_SYNDIC" -eq $BS_TRUE ];then __PACKAGES="${__PACKAGES} salt-syndic" fi - + if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then # We need to install one package at a time because --enablerepo=X disables ALL OTHER REPOS!!!! for package in ${__PACKAGES}; do @@ -3579,7 +3579,7 @@ __freebsd_get_packagesite() { # Using a separate conf step to head for idempotent install... __configure_freebsd_pkg_details() { - ## pkg.conf is deprecated. + ## pkg.conf is deprecated. ## We use conf files in /usr/local or /etc instead mkdir -p /usr/local/etc/pkg/repos/ mkdir -p /etc/pkg/ From 6aa52504d5db5990f791412972261e37fe3d56b7 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 20 Mar 2015 21:49:31 +0100 Subject: [PATCH 05/75] Force LC_ALL=C for chkconfig, since that's LANG dependant On EL 6 and with LANG=fr_FR.utf8 ( as transmitted by ssh ), the script fail. It turn out that running salt-cloud remotely with ssh mean that LANG is transmitted, and chkconfig output is translated. So the grep fail, and so the deploy fail. --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3abbc84..6024b2f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1533,7 +1533,7 @@ __check_services_sysvinit() { servicename=$1 echodebug "Checking if service ${servicename} is enabled" - if [ "$(/sbin/chkconfig --list | grep salt-"$fname" | grep '[2-5]:on')" != "" ]; then + if [ "$(LC_ALL=C /sbin/chkconfig --list | grep salt-"$fname" | grep '[2-5]:on')" != "" ]; then echodebug "Service ${servicename} is enabled" return 0 else From 9f70d8a6c36eb982f7c97dccd8f8b6c41f57782a Mon Sep 17 00:00:00 2001 From: mafro Date: Mon, 16 Mar 2015 08:28:36 +1100 Subject: [PATCH 06/75] Debian 8 Jessie support --- bootstrap-salt.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 00daf99..2e8c4b6 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2137,8 +2137,64 @@ install_debian_7_deps() { return 0 } -install_debian_8_deps__DISABLED() { - install_debian_7_deps || return 1 +install_debian_8_deps() { + echodebug "install_debian_8_deps" + + if [ $_START_DAEMONS -eq $BS_FALSE ]; then + echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." + fi + # No user interaction, libc6 restart services for example + export DEBIAN_FRONTEND=noninteractive + + apt-get update + + # Make sure wget is available + __apt_get_install_noinput wget + + # Install Keys + __apt_get_install_noinput debian-archive-keyring && apt-get update + + # Debian Backports + if [ "$(grep -R 'jessie-backports' /etc/apt | grep -v "^#")" = "" ]; then + echo "deb http://http.debian.net/debian jessie-backports main" >> \ + /etc/apt/sources.list.d/backports.list + fi + + # Saltstack's Stable Debian repository + if [ "$(grep -R 'jessie-saltstack' /etc/apt)" = "" ]; then + echo "deb http://debian.saltstack.com/debian jessie-saltstack main" >> \ + /etc/apt/sources.list.d/saltstack.list + fi + + # shellcheck disable=SC2086 + wget $_WGET_ARGS -q http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key -O - | apt-key add - || return 1 + + apt-get update || return 1 + __apt_get_install_noinput -t jessie-backports libzmq3 libzmq3-dev python-zmq python-requests python-apt || return 1 + + # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 + __PACKAGES="procps pciutils" + # shellcheck disable=SC2086 + __apt_get_install_noinput ${__PACKAGES} || return 1 + + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + __PACKAGES="build-essential python-dev python-pip" + # shellcheck disable=SC2086 + __apt_get_install_noinput ${__PACKAGES} || return 1 + pip install -U "apache-libcloud>=$_LIBCLOUD_MIN_VERSION" + fi + + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then + __apt_get_upgrade_noinput || return 1 + fi + + if [ "${_EXTRA_PACKAGES}" != "" ]; then + echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" + # shellcheck disable=SC2086 + __apt_get_install_noinput ${_EXTRA_PACKAGES} || return 1 + fi + return 0 } @@ -2216,7 +2272,8 @@ install_debian_7_git_deps() { } install_debian_8_git_deps() { - install_debian_7_git_deps || return 1 + install_debian_8_deps || return 1 + install_debian_git_deps || return 1 # Grab the actual deps return 0 } From 41d0564e8267adb881cc2c19c9e7f257bcbd6e7a Mon Sep 17 00:00:00 2001 From: mafro Date: Mon, 16 Mar 2015 08:30:47 +1100 Subject: [PATCH 07/75] Jessie uses systemd --- bootstrap-salt.sh | 54 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2e8c4b6..9e1d99d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2358,19 +2358,33 @@ install_debian_git_post() { [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" ]; then - copyfile "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" "/etc/init.d/salt-$fname" - fi - if [ ! -f "/etc/init.d/salt-$fname" ]; then - echowarn "The init script for salt-$fname was not found, skipping it..." - continue - fi - chmod +x "/etc/init.d/salt-$fname" + if [ -f /bin/systemctl ]; then + if [ ! -f /etc/systemd/system/salt-${fname}.service ] || ([ -f /etc/systemd/system/salt-${fname}.service ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then + copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" /etc/systemd/system + fi - # Skip salt-api since the service should be opt-in and not necessarily started on boot - [ $fname = "api" ] && continue + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + /bin/systemctl enable salt-${fname}.service + SYSTEMD_RELOAD=$BS_TRUE + + elif [ ! -f /etc/init.d/salt-$fname ] || ([ -f /etc/init.d/salt-$fname ] && [ $_FORCE_OVERWRITE -eq $BS_TRUE ]); then + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" ]; then + copyfile "${__SALT_GIT_CHECKOUT_DIR}/debian/salt-$fname.init" "/etc/init.d/salt-$fname" + fi + if [ ! -f "/etc/init.d/salt-$fname" ]; then + echowarn "The init script for salt-$fname was not found, skipping it..." + continue + fi + chmod +x "/etc/init.d/salt-$fname" + + # Skip salt-api since the service should be opt-in and not necessarily started on boot + [ $fname = "api" ] && continue + + update-rc.d "salt-$fname" defaults + fi - update-rc.d "salt-$fname" defaults done } @@ -2386,9 +2400,15 @@ install_debian_restart_daemons() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - - /etc/init.d/salt-$fname stop > /dev/null 2>&1 - /etc/init.d/salt-$fname start + if [ -f /bin/systemctl ]; then + # Debian 8 uses systemd + /bin/systemctl stop salt-$fname > /dev/null 2>&1 + /bin/systemctl start salt-$fname.service + elif [ -f /etc/init.d/salt-$fname ]; then + # Still in SysV init + /etc/init.d/salt-$fname stop > /dev/null 2>&1 + /etc/init.d/salt-$fname start + fi done } @@ -2402,7 +2422,11 @@ install_debian_check_services() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ ! -f "/etc/init.d/salt-$fname" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - __check_services_debian salt-$fname || return 1 + if [ -f /bin/systemctl ]; then + __check_services_systemd salt-$fname || return 1 + elif [ -f /etc/init.d/salt-$fname ]; then + __check_services_debian salt-$fname || return 1 + fi done return 0 } From 2a130c157e5d7b9961225354a9eca5bc0746dcc1 Mon Sep 17 00:00:00 2001 From: Brad Thurber Date: Wed, 25 Mar 2015 11:30:12 -0400 Subject: [PATCH 08/75] don't try to 'yum install git' on centos-like systems if git is already installed --- bootstrap-salt.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 00daf99..4185780 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2678,13 +2678,16 @@ install_centos_stable_post() { install_centos_git_deps() { install_centos_stable_deps || return 1 - if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then - # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! - yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 - else - yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 - fi - + if ! git --version 2>&1 >/dev/null ; then + # git not installed - need to install it + if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then + # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! + yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + else + yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + fi + fi + __git_clone_and_checkout || return 1 # Let's trigger config_salt() From 938b966cefb73ddbc1470c30b0c5b042d36a96f6 Mon Sep 17 00:00:00 2001 From: Brad Thurber Date: Wed, 25 Mar 2015 11:35:25 -0400 Subject: [PATCH 09/75] convert tabs to spaces --- bootstrap-salt.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4185780..74134b1 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2678,16 +2678,16 @@ install_centos_stable_post() { install_centos_git_deps() { install_centos_stable_deps || return 1 - if ! git --version 2>&1 >/dev/null ; then - # git not installed - need to install it - if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then - # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! - yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 - else - yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 - fi - fi - + if ! git --version 2>&1 >/dev/null ; then + # git not installed - need to install it + if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then + # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! + yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + else + yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + fi + fi + __git_clone_and_checkout || return 1 # Let's trigger config_salt() From 85a31a6830b94c59cbabd99ae6511b4d1d1d5099 Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Wed, 1 Apr 2015 00:29:29 +0200 Subject: [PATCH 10/75] \| grouping doesn't work in POSIX sed As part of #550, the reason FreeBSD falls on tags at all (fixed in #564) is because the REPO_URL sed substition line doesn't work in non-Linux sed. This fix replaces it with an equivalent POSIX compliant filter so it works on FreeBSD (and probably Solaris, Nexenta, etc.). This was the only place in the script I could find where this occurs. --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 00daf99..4200b23 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1211,7 +1211,7 @@ __git_clone_and_checkout() { cd "${__SALT_GIT_CHECKOUT_DIR}" fi - if [ "$(echo "$_SALT_REPO_URL" | sed 's/^\(\(git\|https\)\:\/\/github\.com\/saltstack\/salt\.git\|git@github.com\:saltstack\/salt\.git\)$/MATCH/')" != "MATCH" ]; then + if $(echo "$_SALT_REPO_URL" | grep -q -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git'); then # We need to add the saltstack repository as a remote and fetch tags for proper versioning echoinfo "Adding SaltStack's Salt repository as a remote" git remote add upstream "$_SALTSTACK_REPO_URL" || return 1 From a4d9a4def736d4735a7dc5ff390330bc7e74330d Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Wed, 1 Apr 2015 00:43:34 +0200 Subject: [PATCH 11/75] Update bootstrap-salt.sh right, reverse match :) --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4200b23..da0ddae 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1211,7 +1211,7 @@ __git_clone_and_checkout() { cd "${__SALT_GIT_CHECKOUT_DIR}" fi - if $(echo "$_SALT_REPO_URL" | grep -q -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git'); then + if [ $(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git') == 0 ]; then # We need to add the saltstack repository as a remote and fetch tags for proper versioning echoinfo "Adding SaltStack's Salt repository as a remote" git remote add upstream "$_SALTSTACK_REPO_URL" || return 1 From e8a9e6f53b810cd26859774557351dcf04275364 Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Wed, 1 Apr 2015 02:18:08 +0200 Subject: [PATCH 12/75] Fix wrong config paths for FreeBSD (#552) --- bootstrap-salt.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 00daf99..e559462 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3596,7 +3596,7 @@ __configure_freebsd_pkg_details() { copyfile $conf_file /etc/pkg/FreeBSD.conf SALT_PKG_FLAGS="-r FreeBSD" ## ensure future ports builds use pkgng - echo "WITH_PKGNG= yes" >> /etc/make.conf + echo "WITH_PKGNG= yes" >> /etc/make.conf } install_freebsd_9_stable_deps() { @@ -3662,23 +3662,23 @@ install_freebsd_git_deps() { doc/man/salt.7 doc/man/salt.1 doc/man/salt-call.1; do [ ! -f $file ] && continue echodebug "Patching ${file}" - sed -in -e "s|/etc/salt|/usr/local/etc/salt|" \ - -e "s|/srv/salt|/usr/local/etc/salt/states|" \ - -e "s|/srv/pillar|/usr/local/etc/salt/pillar|" ${file} + sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ + -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ + -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" ${file} done if [ ! -f salt/syspaths.py ]; then # We still can't provide the system paths, salt 0.16.x # Let's patch salt's source and adapt paths to what's expected on FreeBSD - echodebug "Replacing occurrences of '/etc/salt' with '/usr/local/etc/salt'" + echodebug "Replacing occurrences of '/etc/salt' with \'${_SALT_ETC_DIR}\'" # The list of files was taken from Salt's BSD port Makefile for file in conf/minion conf/master salt/config.py salt/client.py \ salt/modules/mysql.py salt/utils/parsers.py salt/modules/tls.py \ salt/modules/postgres.py salt/utils/migrations.py; do [ ! -f $file ] && continue echodebug "Patching ${file}" - sed -in -e "s|/etc/salt|/usr/local/etc/salt|" \ - -e "s|/srv/salt|/usr/local/etc/salt/states|" \ - -e "s|/srv/pillar|/usr/local/etc/salt/pillar|" ${file} + sed -in -e "s|/etc/salt|${_SALT_ETC_DIR}|" \ + -e "s|/srv/salt|${_SALT_ETC_DIR}/states|" \ + -e "s|/srv/pillar|${_SALT_ETC_DIR}/pillar|" ${file} done fi echodebug "Finished patching" @@ -3686,7 +3686,7 @@ install_freebsd_git_deps() { # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" - CONFIG_SALT_FUNC="config_salt" + CONFIG_SALT_FUNC="config_freebsd_salt" fi return 0 @@ -3724,9 +3724,9 @@ install_freebsd_git() { --salt-cache-dir=/var/cache/salt \ --salt-sock-dir=/var/run/salt \ --salt-srv-root-dir=/srv \ - --salt-base-file-roots-dir=/usr/local/etc/salt/states \ - --salt-base-pillar-roots-dir=/usr/local/etc/salt/pillar \ - --salt-base-master-roots-dir=/usr/local/etc/salt/salt-master \ + --salt-base-file-roots-dir=${_SALT_ETC_DIR}/states \ + --salt-base-pillar-roots-dir=${_SALT_ETC_DIR}/pillar \ + --salt-base-master-roots-dir=${_SALT_ETC_DIR}/salt-master \ --salt-logs-dir=/var/log/salt \ --salt-pidfile-dir=/var/run \ || return 1 @@ -3758,7 +3758,7 @@ install_freebsd_9_stable_post() { grep "$enable_string" /etc/rc.conf >/dev/null 2>&1 [ $? -eq 1 ] && echo "$enable_string" >> /etc/rc.conf - [ -f /usr/local/etc/salt/${fname}.sample ] && copyfile /usr/local/etc/salt/${fname}.sample /usr/local/etc/salt/${fname} + [ -f ${_SALT_ETC_DIR}/${fname}.sample ] && copyfile ${_SALT_ETC_DIR}/${fname}.sample ${_SALT_ETC_DIR}/${fname} if [ $fname = "minion" ] ; then grep "salt_minion_paths" /etc/rc.conf >/dev/null 2>&1 From f012633278a4c1378e81b01f1ffe10a0265e0623 Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Wed, 1 Apr 2015 02:24:49 +0200 Subject: [PATCH 13/75] == != -eq --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index da0ddae..0f45eb0 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1211,7 +1211,7 @@ __git_clone_and_checkout() { cd "${__SALT_GIT_CHECKOUT_DIR}" fi - if [ $(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git') == 0 ]; then + if [ $(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git') -eq 0 ]; then # We need to add the saltstack repository as a remote and fetch tags for proper versioning echoinfo "Adding SaltStack's Salt repository as a remote" git remote add upstream "$_SALTSTACK_REPO_URL" || return 1 From e90440a8d87bb589c1752876c98ef0f735bfcd57 Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Wed, 1 Apr 2015 02:30:12 +0200 Subject: [PATCH 14/75] fix SC2046 --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 0f45eb0..55247b8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1211,7 +1211,7 @@ __git_clone_and_checkout() { cd "${__SALT_GIT_CHECKOUT_DIR}" fi - if [ $(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git') -eq 0 ]; then + if [ "$(echo "$_SALT_REPO_URL" | grep -c -e '\(\(git\|https\)://github\.com/\|git@github\.com:\)saltstack/salt\.git')" -eq 0 ]; then # We need to add the saltstack repository as a remote and fetch tags for proper versioning echoinfo "Adding SaltStack's Salt repository as a remote" git remote add upstream "$_SALTSTACK_REPO_URL" || return 1 From 1732917b869e6c8050029ef763c05be02bd76876 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 1 Apr 2015 09:49:11 +0100 Subject: [PATCH 15/75] Fix SC2086 - Double quote to prevent globbing and word splitting. Update changes log. --- ChangeLog | 3 +++ bootstrap-salt.sh | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2a641d..777ff7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Version 2015.xx.xx: + * Fix the configuration path for FreeBSD. #567/#552. Thanks Ronald van Zantvoort(The-Loeki). + Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e559462..6d2bb6d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3724,9 +3724,9 @@ install_freebsd_git() { --salt-cache-dir=/var/cache/salt \ --salt-sock-dir=/var/run/salt \ --salt-srv-root-dir=/srv \ - --salt-base-file-roots-dir=${_SALT_ETC_DIR}/states \ - --salt-base-pillar-roots-dir=${_SALT_ETC_DIR}/pillar \ - --salt-base-master-roots-dir=${_SALT_ETC_DIR}/salt-master \ + --salt-base-file-roots-dir="${_SALT_ETC_DIR}/states" \ + --salt-base-pillar-roots-dir="${_SALT_ETC_DIR}/pillar" \ + --salt-base-master-roots-dir="${_SALT_ETC_DIR}/salt-master" \ --salt-logs-dir=/var/log/salt \ --salt-pidfile-dir=/var/run \ || return 1 @@ -3758,7 +3758,7 @@ install_freebsd_9_stable_post() { grep "$enable_string" /etc/rc.conf >/dev/null 2>&1 [ $? -eq 1 ] && echo "$enable_string" >> /etc/rc.conf - [ -f ${_SALT_ETC_DIR}/${fname}.sample ] && copyfile ${_SALT_ETC_DIR}/${fname}.sample ${_SALT_ETC_DIR}/${fname} + [ -f "${_SALT_ETC_DIR}/${fname}.sample" ] && copyfile "${_SALT_ETC_DIR}/${fname}.sample" "${_SALT_ETC_DIR}/${fname}" if [ $fname = "minion" ] ; then grep "salt_minion_paths" /etc/rc.conf >/dev/null 2>&1 From aff1e0d43ecf8df3bbe1a5a75909920fcd50ab73 Mon Sep 17 00:00:00 2001 From: Diego Woitasen Date: Fri, 3 Apr 2015 21:07:32 -0300 Subject: [PATCH 16/75] Diego Woitasen mail address updated. --- AUTHORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 84fab10..1c6b84d 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -19,7 +19,7 @@ Christer Edwards cedwards Dag Viggo Lokøen dagvl dag.viggo@lokoen.org Dan Mick dmick dan.mick@inktank.com deployboy deployboy -Diego Woitasen diegows diego.woitasen@vhgroup.net +Diego Woitasen diegows diego@flugel.it Elias Probst eliasp Erik Johnson terminalmage erik@saltstack.com Forrest Alvarez gravyboat From d5fe85772304a5e2c6cfce1dcac0d0c161b9a49d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Apr 2015 01:19:44 +0100 Subject: [PATCH 17/75] Add Matt Black(@mafrosis) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 84fab10..7b2e8eb 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -39,6 +39,7 @@ Karl Grzeszczak karlgrz Kenneth Wilke KennethWilke Liu Xiaohui oreh herolxh@gmail.com markgaylard markgaylard +Matt Black mafrosis Matthew Garrett cingeyedog matt@clemson.edu Matthew Mead-Briggs mattmb Matthew Willson ixela From d9db807b0f8f0c1db4433c2d0675a9abfbd04535 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Apr 2015 01:22:12 +0100 Subject: [PATCH 18/75] Update changes log --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 777ff7c..1624e64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Version 2015.xx.xx: * Fix the configuration path for FreeBSD. #567/#552. Thanks Ronald van Zantvoort(The-Loeki). + + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). + * Add Debian 8 support. Thanks Matt Black(mafrosis) Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From a6b6341a2c6b0510f96574d1259d6952a4237ae6 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Apr 2015 02:46:36 +0100 Subject: [PATCH 19/75] Add Michael Scherer(@mscherer) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 08db00d..76c1a3e 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -44,6 +44,7 @@ Matthew Garrett cingeyedog matt@clemson.edu Matthew Mead-Briggs mattmb Matthew Willson ixela Matthieu Guegan mguegan +Michael Scherer mscherer Mike Carlson m87carlson mike@bayphoto.com Mike Place cachedout mp@saltstack.com nevins-b nevins-b From ee2738b6975b246e3b4dab9ece036593b942b3d9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Apr 2015 02:52:15 +0100 Subject: [PATCH 20/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 1624e64..11a6998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Version 2015.xx.xx: * Fix the configuration path for FreeBSD. #567/#552. Thanks Ronald van Zantvoort(The-Loeki). + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). * Add Debian 8 support. Thanks Matt Black(mafrosis) + * Improve Debian version parsing. Thanks Mark Lee(malept) Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 1e6f249ea1d66dc99f5cd035fac9acc2389472c9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sat, 4 Apr 2015 02:52:42 +0100 Subject: [PATCH 21/75] Add Mark Lee(@malept) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 76c1a3e..a4510f6 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -39,6 +39,7 @@ Karl Grzeszczak karlgrz Kenneth Wilke KennethWilke Liu Xiaohui oreh herolxh@gmail.com markgaylard markgaylard +Mark Lee malept Matt Black mafrosis Matthew Garrett cingeyedog matt@clemson.edu Matthew Mead-Briggs mattmb From be73cb4067625e6a5fcaa7a9d7361ff86a305217 Mon Sep 17 00:00:00 2001 From: Ronald van Zantvoort Date: Sat, 4 Apr 2015 15:44:43 +0200 Subject: [PATCH 22/75] Fix #532 --- bootstrap-salt.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 13d4993..5f0e460 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -981,6 +981,10 @@ __ubuntu_derivatives_translation() { "elementary_os") _major=$(echo "$DISTRO_VERSION" | sed 's/\.//g') ;; + "linuxmint") + export LSB_ETC_LSB_RELEASE=/etc/upstream-release/lsb-release + _major=$(echo "$DISTRO_VERSION" | sed 's/^\([0-9]*\).*/\1/g') + ;; *) _major=$(echo "$DISTRO_VERSION" | sed 's/^\([0-9]*\).*/\1/g') ;; From c991a973fb75fab5a1f7e1f6e45bbd1951c31ace Mon Sep 17 00:00:00 2001 From: "David J. Felix" Date: Sun, 5 Apr 2015 02:15:28 -0400 Subject: [PATCH 23/75] Fix RST markup in Readme - There should be a space for proper code rendering syntax --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index f01b868..8815e28 100644 --- a/README.rst +++ b/README.rst @@ -88,19 +88,19 @@ have ``fetch`` available though: If you have any SSL issues install ``ca_root_nssp``: -..code:: console +.. code:: console pkg install ca_root_nssp And either copy the certificates to the place where fetch can find them: -..code:: console +.. code:: console cp /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem Or link them to the right place: -..code:: console +.. code:: console ln -s /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem From 291bac5c1835b6d87470ce1e8753c6b0a2fe90f0 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 8 Apr 2015 16:57:06 +0100 Subject: [PATCH 24/75] We need patch installed --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 13d4993..4e2da55 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4096,7 +4096,7 @@ install_opensuse_stable_deps() { install_opensuse_git_deps() { install_opensuse_stable_deps || return 1 - zypper --non-interactive install --auto-agree-with-licenses git || return 1 + zypper --non-interactive install --auto-agree-with-licenses git patch || return 1 __git_clone_and_checkout || return 1 From 52e3fad33648907446271e1854c7143dce378766 Mon Sep 17 00:00:00 2001 From: Erik Ankrom Date: Thu, 9 Apr 2015 00:02:00 -0500 Subject: [PATCH 25/75] add Debian Archive Automatic Signing Key See #557 --- bootstrap-salt.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4e2da55..629235b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2018,6 +2018,11 @@ install_debian_6_deps() { # Install Keys __apt_get_install_noinput debian-archive-keyring && apt-get update + # Install Debian Archive Automatic Signing Key (6.0/squeeze), see #557 + if [ -z "$(apt-key finger |grep '9FED 2BCB DCD2 9CDF 7626 78CB AED4 B06F 4730 41FA')"]; then + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AED4B06F473041FA || return 1 + fi + # shellcheck disable=SC2086 wget $_WGET_ARGS -q http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key -O - | apt-key add - || return 1 @@ -2115,6 +2120,11 @@ install_debian_7_deps() { # Install Keys __apt_get_install_noinput debian-archive-keyring && apt-get update + # Install Debian Archive Automatic Signing Key (7.0/wheezy), see #557 + if [ -z "$(apt-key finger |grep 'A1BD 8E9D 78F7 FE5C 3E65 D8AF 8B48 AD62 4692 5553')"]; then + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 || return 1 + fi + # Debian Backports if [ "$(grep -R 'wheezy-backports' /etc/apt | grep -v "^#")" = "" ]; then echo "deb http://http.debian.net/debian wheezy-backports main" >> \ @@ -2175,6 +2185,11 @@ install_debian_8_deps() { # Install Keys __apt_get_install_noinput debian-archive-keyring && apt-get update + # Debian Archive Automatic Signing Key (8/jessie), see #557 + if [ -z "$(apt-key finger |grep '126C 0D24 BD8A 2942 CC7D F8AC 7638 D044 2B90 D010')"]; then + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 || return 1 + fi + # Debian Backports if [ "$(grep -R 'jessie-backports' /etc/apt | grep -v "^#")" = "" ]; then echo "deb http://http.debian.net/debian jessie-backports main" >> \ From 6cac1b672ccbe74a464aa59c35bcef8c52fc2a99 Mon Sep 17 00:00:00 2001 From: Nitin Madhok Date: Fri, 10 Apr 2015 15:39:05 -0400 Subject: [PATCH 26/75] Fix issue where bootstrap script fails if a private epel repo has been configured and if the server cannot access external network Fixes #576 --- bootstrap-salt.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4e2da55..7fb1a8b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2608,6 +2608,13 @@ __install_epel_repository() { return 0 fi + # Check if epel repo is already enabled and flag it accordingly + yum repolist | grep -i "epel" > /dev/null 2>&1 + if [ $? -eq 0 ]; then + __EPEL_REPOS_INSTALLED=${BS_TRUE} + return 0 + fi + # Check if epel-release is already installed and flag it accordingly rpm --nodigest --nosignature -q epel-release > /dev/null 2>&1 if [ $? -eq 0 ]; then From 917460bfb3f2252d5803b553d3e910907a7a0065 Mon Sep 17 00:00:00 2001 From: Cameron Sparr Date: Mon, 13 Apr 2015 16:20:49 -0600 Subject: [PATCH 27/75] Fixes #578, set env DEBIAN_FRONTEND=noninteractive --- bootstrap-salt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4e2da55..1e9a3ae 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1704,6 +1704,8 @@ install_ubuntu_deps() { if [ $_START_DAEMONS -eq $BS_FALSE ]; then echowarn "Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour." fi + # No user interaction, libc6 restart services for example + export DEBIAN_FRONTEND=noninteractive apt-get update From e91bef3adfdb3228fa33fb7aab598cb940013171 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 19 Apr 2015 23:21:32 -0500 Subject: [PATCH 28/75] README: code directive fixes --- README.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index f01b868..3a63211 100644 --- a/README.rst +++ b/README.rst @@ -88,19 +88,19 @@ have ``fetch`` available though: If you have any SSL issues install ``ca_root_nssp``: -..code:: console +.. code:: console pkg install ca_root_nssp And either copy the certificates to the place where fetch can find them: -..code:: console +.code:: console cp /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem Or link them to the right place: -..code:: console +.. code:: console ln -s /usr/local/share/certs/ca-root-nss.crt /etc/ssl/cert.pem @@ -381,7 +381,9 @@ Please run the following commands and report their output when creating a ticket Testing in Vagrant ------------------ You can use Vagrant_ to easily test changes on a clean machine. The ``Vagrantfile`` defaults to an -Ubuntu box. First, install Vagrant, then:: +Ubuntu box. First, install Vagrant, then: + +.. code:: console $ vagrant up $ vagrant ssh From f21250b9cfbcca31f19bc479d24549b606f2226b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:24:43 +0100 Subject: [PATCH 29/75] Make sure CentOS 5 COPR repository takes priority over EPEL --- bootstrap-salt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 4e2da55..18a3a85 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2652,8 +2652,10 @@ __install_saltstack_copr_zeromq_repository() { __install_saltstack_copr_salt_el5_repository() { if [ ! -s /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo ]; then + yum -y install yum-priorities || return 1 __fetch_url /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo \ "http://copr.fedoraproject.org/coprs/saltstack/salt-el5/repo/epel-5/saltstack-salt-el5-epel-5.repo" || return 1 + grep -q priority /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo || echo 'priority=1' >> /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo fi return 0 } From 62c429c6dfc634667d7ce565af07ff8ba77cbe81 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:25:29 +0100 Subject: [PATCH 30/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 11a6998..eb50b0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Version 2015.xx.xx: + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). * Add Debian 8 support. Thanks Matt Black(mafrosis) * Improve Debian version parsing. Thanks Mark Lee(malept) + * Make sure CentOS 5 COPR repository takes priority over EPEL Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 9557aa1a8ac41c83105e6311bbbd8ce0f81e28de Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:26:44 +0100 Subject: [PATCH 31/75] Add David J. Felix(@DavidJFelix) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index a4510f6..91e0031 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -18,6 +18,7 @@ Chris Rebert cvrebert chris.rebert@hulu.com Christer Edwards cedwards Dag Viggo Lokøen dagvl dag.viggo@lokoen.org Dan Mick dmick dan.mick@inktank.com +David J. Felix DavidJFelix deployboy deployboy Diego Woitasen diegows diego@flugel.it Elias Probst eliasp From 0c34e38bffa5b49ee851ede5197a43a1046cf61a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:29:59 +0100 Subject: [PATCH 32/75] Add Tony Narlock(@tony) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 91e0031..875e720 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -62,6 +62,7 @@ Ronald van Zantvoort The-Loeki ronald@pcextreme.nl Skyler Berg skylerberg skylertheberg@gmail.com Tate Eskew tateeskew Thomas S. Hatch thatch45 thatch45@saltstack.com +Tony Narlock tony Valentin Bud valentinbud valentin@databus.pro Vladimir Kozhukalov kozhukalov Whit Morriss whitmo whit@nocoast.us From a9829dcb546d2f5e81ea018d14e311a219bbb564 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:34:13 +0100 Subject: [PATCH 33/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index eb50b0a..3bbcfb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Version 2015.xx.xx: * Add Debian 8 support. Thanks Matt Black(mafrosis) * Improve Debian version parsing. Thanks Mark Lee(malept) * Make sure CentOS 5 COPR repository takes priority over EPEL + * Make sure we disable user interaction on Ubuntu. Thanks Cam(cameronsparr). #578, #579 Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From d16e23d1074b1ef97743c84b5dc9c235fc1d8801 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:35:22 +0100 Subject: [PATCH 34/75] Add Cam(@camereonsparr) to AUTHORS --- AUTHORS.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 875e720..de8a09f 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -14,6 +14,7 @@ Ari Aosved devaos ari.aosved@gmail.com Boris Feld Lothiraldan bruce-one bruce-one C. R. Oldham cro cr@saltstack.com +Cam camereonsparr Chris Rebert cvrebert chris.rebert@hulu.com Christer Edwards cedwards Dag Viggo Lokøen dagvl dag.viggo@lokoen.org @@ -39,8 +40,8 @@ Juan A. Moyano wincus wincus.public@gmail.com Karl Grzeszczak karlgrz Kenneth Wilke KennethWilke Liu Xiaohui oreh herolxh@gmail.com -markgaylard markgaylard Mark Lee malept +markgaylard markgaylard Matt Black mafrosis Matthew Garrett cingeyedog matt@clemson.edu Matthew Mead-Briggs mattmb From 76c0c4c554aadcda4c93dc27c96d202ff1c9dc53 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:38:51 +0100 Subject: [PATCH 35/75] Update changes log --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3bbcfb1..a7dc46a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ Version 2015.xx.xx: * Improve Debian version parsing. Thanks Mark Lee(malept) * Make sure CentOS 5 COPR repository takes priority over EPEL * Make sure we disable user interaction on Ubuntu. Thanks Cam(cameronsparr). #578, #579 + * Don't try to add the EPEL repo if it's already configured. Thanks Nitin Madhok(nmadhok). + #576, #577 Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 6ca99e9e8d3c7aaaed4c924ec71bce66e9c59410 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:39:31 +0100 Subject: [PATCH 36/75] Add Nitin Madhok(@nmadhok) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index de8a09f..4c2f1f7 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -52,6 +52,7 @@ Mike Carlson m87carlson mike@bayphoto.com Mike Place cachedout mp@saltstack.com nevins-b nevins-b Niels Abspoel aboe76 +Nitin Madhok nmadhok nmadhok@clemson.edu Paul Brian lifeisstillgood paul@mikadosoftware.com Pavel Snagovsky paha Pedro Algarvio s0undt3ch pedro@algarvio.me From 02fe805d56ce30cacef2cb6c25305a66d33764f6 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:42:38 +0100 Subject: [PATCH 37/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index a7dc46a..01ed477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ Version 2015.xx.xx: * Make sure we disable user interaction on Ubuntu. Thanks Cam(cameronsparr). #578, #579 * Don't try to add the EPEL repo if it's already configured. Thanks Nitin Madhok(nmadhok). #576, #577 + * Fix adding repositories in Linux Mint. Thanks Ronald van Zantvoort(The-Loeki). #532, #570. Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From bee3e700d5eccebd39f19e5fa2cf8130451dc198 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 10:59:48 +0100 Subject: [PATCH 38/75] Lint fixes --- bootstrap-salt.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index bb5c0e9..2da58e5 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2025,7 +2025,7 @@ install_debian_6_deps() { __apt_get_install_noinput debian-archive-keyring && apt-get update # Install Debian Archive Automatic Signing Key (6.0/squeeze), see #557 - if [ -z "$(apt-key finger |grep '9FED 2BCB DCD2 9CDF 7626 78CB AED4 B06F 4730 41FA')"]; then + if [ "$(apt-key finger | grep '9FED 2BCB DCD2 9CDF 7626 78CB AED4 B06F 4730 41FA')" = "" ]; then apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AED4B06F473041FA || return 1 fi @@ -2127,7 +2127,7 @@ install_debian_7_deps() { __apt_get_install_noinput debian-archive-keyring && apt-get update # Install Debian Archive Automatic Signing Key (7.0/wheezy), see #557 - if [ -z "$(apt-key finger |grep 'A1BD 8E9D 78F7 FE5C 3E65 D8AF 8B48 AD62 4692 5553')"]; then + if [ "$(apt-key finger | grep 'A1BD 8E9D 78F7 FE5C 3E65 D8AF 8B48 AD62 4692 5553')" = "" ]; then apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553 || return 1 fi @@ -2191,9 +2191,9 @@ install_debian_8_deps() { # Install Keys __apt_get_install_noinput debian-archive-keyring && apt-get update - # Debian Archive Automatic Signing Key (8/jessie), see #557 - if [ -z "$(apt-key finger |grep '126C 0D24 BD8A 2942 CC7D F8AC 7638 D044 2B90 D010')"]; then - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 || return 1 + # Install Debian Archive Automatic Signing Key (8/jessie), see #557 + if [ "$(apt-key finger | grep '126C 0D24 BD8A 2942 CC7D F8AC 7638 D044 2B90 D010')" = "" ]; then + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010 || return 1 fi # Debian Backports From 22309631bde9d7db7152e16c6b3406c61ebb25d5 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 12:08:10 +0100 Subject: [PATCH 39/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 01ed477..143fddf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ Version 2015.xx.xx: * Don't try to add the EPEL repo if it's already configured. Thanks Nitin Madhok(nmadhok). #576, #577 * Fix adding repositories in Linux Mint. Thanks Ronald van Zantvoort(The-Loeki). #532, #570. + * Add Debian Archive Automatic Signing Key. Thanks Erik Ankrom(erikankrom). #574 Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 9af2bf3bb3a857865f3e5576a3bbff9f233f4412 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 22 Apr 2015 12:08:55 +0100 Subject: [PATCH 40/75] Add Erik Ankrom(@erikankrom) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 4c2f1f7..b17ecba 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -23,6 +23,7 @@ David J. Felix DavidJFelix deployboy deployboy Diego Woitasen diegows diego@flugel.it Elias Probst eliasp +Erik Ankrom erikankrom Erik Johnson terminalmage erik@saltstack.com Forrest Alvarez gravyboat Fred Reimer freimer freimer@freimer.org From decccf408f92f3156d273df1caa487e0726d178c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Apr 2015 12:25:14 +0100 Subject: [PATCH 41/75] Revert "Update changes log" This reverts commit 62c429c6dfc634667d7ce565af07ff8ba77cbe81. --- ChangeLog | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 143fddf..11a6998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,12 +3,6 @@ Version 2015.xx.xx: + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). * Add Debian 8 support. Thanks Matt Black(mafrosis) * Improve Debian version parsing. Thanks Mark Lee(malept) - * Make sure CentOS 5 COPR repository takes priority over EPEL - * Make sure we disable user interaction on Ubuntu. Thanks Cam(cameronsparr). #578, #579 - * Don't try to add the EPEL repo if it's already configured. Thanks Nitin Madhok(nmadhok). - #576, #577 - * Fix adding repositories in Linux Mint. Thanks Ronald van Zantvoort(The-Loeki). #532, #570. - * Add Debian Archive Automatic Signing Key. Thanks Erik Ankrom(erikankrom). #574 Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 01a7989723cbd98aadcef00a45cb9760bfb5686e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Apr 2015 12:25:27 +0100 Subject: [PATCH 42/75] Revert "Make sure CentOS 5 COPR repository takes priority over EPEL" This reverts commit f21250b9cfbcca31f19bc479d24549b606f2226b. --- bootstrap-salt.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2da58e5..c9ee38f 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2680,10 +2680,8 @@ __install_saltstack_copr_zeromq_repository() { __install_saltstack_copr_salt_el5_repository() { if [ ! -s /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo ]; then - yum -y install yum-priorities || return 1 __fetch_url /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo \ "http://copr.fedoraproject.org/coprs/saltstack/salt-el5/repo/epel-5/saltstack-salt-el5-epel-5.repo" || return 1 - grep -q priority /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo || echo 'priority=1' >> /etc/yum.repos.d/saltstack-salt-el5-epel-5.repo fi return 0 } From 9185948cf2bca1f616a92e4e38e2b67fe93cfbfe Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Apr 2015 15:23:19 +0100 Subject: [PATCH 43/75] Make sure we update packages list one Chris Lea's PPA repository is added --- bootstrap-salt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c9ee38f..64ace4c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1744,6 +1744,7 @@ install_ubuntu_deps() { if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then echoinfo "Installing ZMQ>=4/PyZMQ>=14 from Chris Lea's PPA repository" add-apt-repository -y ppa:chris-lea/zeromq || return 1 + apt-get update fi __apt_get_install_noinput python-requests __PIP_PACKAGES="" From ab3dac2c275308e06739450b7ab10bf1f75a97b4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 24 Apr 2015 15:24:24 +0100 Subject: [PATCH 44/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 11a6998..85a1ef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Version 2015.xx.xx: + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). * Add Debian 8 support. Thanks Matt Black(mafrosis) * Improve Debian version parsing. Thanks Mark Lee(malept) + * Make sure we update packages list one Chris Lea's PPA repository is added. Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From ad2cd768e0a633279d0f565210383ce2974fdaca Mon Sep 17 00:00:00 2001 From: wfhg Date: Wed, 29 Apr 2015 10:58:16 +0200 Subject: [PATCH 45/75] Added to readme: supported OS SLES 11 SP3. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index eba144d..ab2824f 100644 --- a/README.rst +++ b/README.rst @@ -332,7 +332,7 @@ Supported Operating Systems - Red Hat Enterprise 5/6 - Scientific Linux 5/6 - SmartOS -- SuSE 11 SP1/11 SP2 +- SUSE Linux Enterprise 11 SP1/11 SP2/11 SP3 - Ubuntu 10.x/11.x/12.x/13.04/13.10 - Elementary OS 0.2 From aebf47f1b72cd96caec20c5afc1d1a71e7410d77 Mon Sep 17 00:00:00 2001 From: panticz Date: Mon, 27 Apr 2015 18:08:56 +0200 Subject: [PATCH 46/75] Fix Debian Squeeze backports mirror http://http.debian.net/debian-backports is not available anymore --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 64ace4c..139ce83 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2073,7 +2073,7 @@ _eof # Debian Backports if [ "$(grep -R 'squeeze-backports' /etc/apt | grep -v "^#")" = "" ]; then - echo "deb http://http.debian.net/debian-backports squeeze-backports main" >> \ + echo "deb http://ftp.de.debian.org/debian-backports squeeze-backports main" >> \ /etc/apt/sources.list.d/backports.list fi From 25b10c0e21bb9c4f71cbb6a8c265d924302047ab Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 11:59:15 +0100 Subject: [PATCH 47/75] Add @panticz to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index b17ecba..56786a6 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -54,6 +54,7 @@ Mike Place cachedout mp@saltstack.com nevins-b nevins-b Niels Abspoel aboe76 Nitin Madhok nmadhok nmadhok@clemson.edu +panticz panticz Paul Brian lifeisstillgood paul@mikadosoftware.com Pavel Snagovsky paha Pedro Algarvio s0undt3ch pedro@algarvio.me From 585b1f29af76be5824f4ba79a12e1f9e519c6b01 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:00:33 +0100 Subject: [PATCH 48/75] Add Wout(@wfhg) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 56786a6..d9aa661 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -70,4 +70,5 @@ Tony Narlock tony Valentin Bud valentinbud valentin@databus.pro Vladimir Kozhukalov kozhukalov Whit Morriss whitmo whit@nocoast.us +Wout wfhg ========================== ===================== ============================ From dad73a89cfe24f116323b8a5dcf68e81585047bd Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:02:11 +0100 Subject: [PATCH 49/75] Update changes log --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 85a1ef7..03696c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ Version 2015.xx.xx: * Add Debian 8 support. Thanks Matt Black(mafrosis) * Improve Debian version parsing. Thanks Mark Lee(malept) * Make sure we update packages list one Chris Lea's PPA repository is added. + * Hard code the Debian Squeeze backports to the DE mirror since the main repository is down. + Thanks @panticz. #589. Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From c8a8e1a226b7a2d463c8ac1b5b99167a55ac749d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:05:57 +0100 Subject: [PATCH 50/75] Separate installing git and systemd-python --- bootstrap-salt.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f259cf4..5483f20 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2809,15 +2809,21 @@ install_centos_stable_post() { install_centos_git_deps() { install_centos_stable_deps || return 1 - if ! git --version 2>&1 >/dev/null ; then + if [ "$(which git)" = "" ]; then # git not installed - need to install it if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! - yum install -y git systemd-python || yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + yum install -y git || yum install -y git --enablerepo=${_EPEL_REPO} || return 1 else - yum install -y git systemd-python --enablerepo=${_EPEL_REPO} || return 1 + yum install -y git --enablerepo=${_EPEL_REPO} || return 1 fi fi + if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then + # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! + yum install -y systemd-python || yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 + else + yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 + fi __git_clone_and_checkout || return 1 From 404cb2cc53a3f4cdd69934bf5798dcd8c6cf5db4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:06:36 +0100 Subject: [PATCH 51/75] Add Brad Thurber(@bradthurber) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index d9aa661..84c29ac 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -12,6 +12,7 @@ Alex Van't Hof alexvh Angelo Gründler plueschopath angelo.gruendler@w1r3.net Ari Aosved devaos ari.aosved@gmail.com Boris Feld Lothiraldan +Brad Thurber bradthurber bruce-one bruce-one C. R. Oldham cro cr@saltstack.com Cam camereonsparr From ce03e5b493b4b62e5d7cf7f43618b6492e7a607f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:12:22 +0100 Subject: [PATCH 52/75] Only install git if necessary(for all the other distributions) Fixes #560 --- bootstrap-salt.sh | 53 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5483f20..f269eaa 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2253,9 +2253,12 @@ install_debian_git_deps() { # Install Keys __apt_get_install_noinput debian-archive-keyring && apt-get update + if [ "$(which git)" = "" ]; then + __apt_get_install_noinput git || return 1 + fi + __apt_get_install_noinput lsb-release python python-pkg-resources python-crypto \ - python-jinja2 python-m2crypto python-yaml msgpack-python python-pip \ - git || return 1 + python-jinja2 python-m2crypto python-yaml msgpack-python python-pip || return 1 __git_clone_and_checkout || return 1 @@ -2287,8 +2290,13 @@ install_debian_6_git_deps() { install_debian_6_deps || return 1 if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then easy_install -U Jinja2 || return 1 + + if [ "$(which git)" = "" ]; then + __apt_get_install_noinput git || return 1 + fi + __apt_get_install_noinput lsb-release python python-pkg-resources python-crypto \ - python-m2crypto python-yaml msgpack-python python-pip git || return 1 + python-m2crypto python-yaml msgpack-python python-pip || return 1 __git_clone_and_checkout || return 1 @@ -2542,7 +2550,11 @@ install_fedora_stable_post() { install_fedora_git_deps() { install_fedora_deps || return 1 - yum install -y git systemd-python || return 1 + if [ "$(which git)" = "" ]; then + yum install -y git || return 1 + fi + + yum install -y systemd-python || return 1 __git_clone_and_checkout || return 1 @@ -3448,7 +3460,10 @@ install_amazon_linux_ami_deps() { install_amazon_linux_ami_git_deps() { install_amazon_linux_ami_deps || return 1 - yum -y install git --enablerepo=${_EPEL_REPO} || return 1 + + if [ "$(which git)" = "" ]; then + yum -y install git --enablerepo=${_EPEL_REPO} || return 1 + fi __git_clone_and_checkout || return 1 @@ -3537,8 +3552,11 @@ install_arch_linux_git_deps() { install_arch_linux_stable_deps # Don't fail if un-installing python2-distribute threw an error + if [ "$(which git)" = "" ]; then + pacman -Sy --noconfirm --needed git || return 1 + fi pacman -R --noconfirm python2-distribute - pacman -Sy --noconfirm --needed git python2-crypto python2-setuptools python2-jinja \ + pacman -Sy --noconfirm --needed python2-crypto python2-setuptools python2-jinja \ python2-m2crypto python2-markupsafe python2-msgpack python2-psutil python2-yaml \ python2-pyzmq zeromq python2-requests python2-systemd || return 1 @@ -3791,7 +3809,11 @@ config_freebsd_salt() { install_freebsd_git_deps() { install_freebsd_9_stable_deps || return 1 - /usr/local/sbin/pkg install -y git www/py-requests || return 1 + if [ "$(which git)" = "" ]; then + /usr/local/sbin/pkg install -y git || return 1 + fi + + /usr/local/sbin/pkg install -y www/py-requests || return 1 __git_clone_and_checkout || return 1 @@ -3977,7 +3999,10 @@ install_smartos_deps() { install_smartos_git_deps() { install_smartos_deps || return 1 - pkgin -y install scmgit || return 1 + + if [ "$(which git)" = "" ]; then + pkgin -y install scmgit || return 1 + fi __git_clone_and_checkout || return 1 # Let's trigger config_salt() @@ -4134,7 +4159,12 @@ install_opensuse_stable_deps() { install_opensuse_git_deps() { install_opensuse_stable_deps || return 1 - zypper --non-interactive install --auto-agree-with-licenses git patch || return 1 + + if [ "$(which git)" = "" ]; then + zypper --non-interactive install --auto-agree-with-licenses git || return 1 + fi + + zypper --non-interactive install --auto-agree-with-licenses patch || return 1 __git_clone_and_checkout || return 1 @@ -4365,7 +4395,10 @@ install_suse_11_stable_deps() { install_suse_11_git_deps() { install_suse_11_stable_deps || return 1 - zypper --non-interactive install --auto-agree-with-licenses git || return 1 + + if [ "$(which git)" = "" ]; then + zypper --non-interactive install --auto-agree-with-licenses git || return 1 + fi __git_clone_and_checkout || return 1 From 9aa7396121224f5fe0f365fb73fec3a58b4b8132 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 12:14:18 +0100 Subject: [PATCH 53/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 03696c3..2814ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Version 2015.xx.xx: * Make sure we update packages list one Chris Lea's PPA repository is added. * Hard code the Debian Squeeze backports to the DE mirror since the main repository is down. Thanks @panticz. #589. + * Only install git if not already installed. #560 Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 1bdde390c0e7591cf6cd3980f8030717d9e8693c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 13:17:49 +0100 Subject: [PATCH 54/75] Add Roman Inflianskas(@rominf) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 84c29ac..c49c0cf 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -63,6 +63,7 @@ Pedro Paulo pedropaulovc ptonelli ptonelli Raymond Barbiero visualphoenix Roberto Aguilar rca roberto@baremetal.io +Roman Inflianskas rominf Ronald van Zantvoort The-Loeki ronald@pcextreme.nl Skyler Berg skylerberg skylertheberg@gmail.com Tate Eskew tateeskew From a7caab51c9451afb8136d55a4a144d3ab7583335 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 13:18:03 +0100 Subject: [PATCH 55/75] Update changes log --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2814ff6..4a459ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ Version 2015.xx.xx: * Hard code the Debian Squeeze backports to the DE mirror since the main repository is down. Thanks @panticz. #589. * Only install git if not already installed. #560 + * Fix openSUSE 13.2 where we need to pass --replaceflags. Thanks Roman Inflianskas(rominf). + #504. Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 1d09eaeb5d75d9ec2d268cd0968da73c3f3662ba Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 14:27:04 +0100 Subject: [PATCH 56/75] Make sure that a recent enough requests package is installed in Debian/Ubuntu Fixes #497 Closes #503 --- bootstrap-salt.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 3342f91..5358109 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -208,6 +208,7 @@ _SALT_MINION_ID="null" # __SIMPLIFY_VERSION is mostly used in Solaris based distributions __SIMPLIFY_VERSION=$BS_TRUE _LIBCLOUD_MIN_VERSION="0.14.0" +_PY_REQUESTS_MIN_VERSION="2.4.3" _EXTRA_PACKAGES="" _HTTP_PROXY="" __SALT_GIT_CHECKOUT_DIR=${BS_SALT_GIT_CHECKOUT_DIR:-/tmp/git/salt} @@ -1751,8 +1752,7 @@ install_ubuntu_deps() { else check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package 'requests'" __apt_get_install_noinput python-setuptools python-pip - __PIP_PACKAGES="requests" - pip install requests + __PIP_PACKAGES="'requests>=$_PY_REQUESTS_MIN_VERSION'" fi # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 @@ -1984,7 +1984,7 @@ install_debian_deps() { check_pip_allowed "You need to allow pip based installations (-P) in order to install the python 'requests' package" # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 __PACKAGES="${__PACKAGES} python-pip" - __PIP_PACKAGES="${__PIP_PACKAGES} requests" + __PIP_PACKAGES="${__PIP_PACKAGES} 'requests>=$_PY_REQUESTS_MIN_VERSION'" fi # shellcheck disable=SC2086 @@ -2086,15 +2086,16 @@ _eof # Python requests is available through Squeeze backports # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 - __apt_get_install_noinput python-requests python-pip procps pciutils + __apt_get_install_noinput python-pip procps pciutils # Need python-apt for managing packages via Salt __apt_get_install_noinput python-apt if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then - check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud/requests" __apt_get_install_noinput python-pip - pip install -U "apache-libcloud>=$_LIBCLOUD_MIN_VERSION" + pip install -U "apache-libcloud>=$_LIBCLOUD_MIN_VERSION 'requests>=$_PY_REQUESTS_MIN_VERSION'" + fi if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then @@ -2148,18 +2149,18 @@ install_debian_7_deps() { wget $_WGET_ARGS -q http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key -O - | apt-key add - || return 1 apt-get update || return 1 - __apt_get_install_noinput -t wheezy-backports libzmq3 libzmq3-dev python-zmq python-requests python-apt || return 1 + __apt_get_install_noinput -t wheezy-backports libzmq3 libzmq3-dev python-zmq python-apt || return 1 # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 __PACKAGES="procps pciutils" # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then - check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud/requests" __PACKAGES="build-essential python-dev python-pip" # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - pip install -U "apache-libcloud>=$_LIBCLOUD_MIN_VERSION" + pip install -U "'apache-libcloud>=$_LIBCLOUD_MIN_VERSION' 'requests>=$_PY_REQUESTS_MIN_VERSION'" fi if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then From 3c5b3d6dce7894a780bc95a678b808d048380d2d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 14:41:25 +0100 Subject: [PATCH 57/75] Update changes log --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4a459ba..2faad11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ Version 2015.xx.xx: * Only install git if not already installed. #560 * Fix openSUSE 13.2 where we need to pass --replaceflags. Thanks Roman Inflianskas(rominf). #504. + * Make sure that a recent enough requests package is installed in Debian/Ubuntu. + Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 From 61bea8dc2ca1bed394ab019aec79331b12d42872 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 14:42:40 +0100 Subject: [PATCH 58/75] Lint fixes --- bootstrap-salt.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5358109..203c196 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -772,7 +772,7 @@ __gather_linux_system_info() { n=$(echo "${rsource}" | sed -e 's/[_-]release$//' -e 's/[_-]version$//') shortname=$(echo "${n}" | tr '[:upper:]' '[:lower:]') if [ "$shortname" = "debian" ]; then - rv=$(__derive_debian_numeric_version `cat /etc/${rsource}`) + rv=$(__derive_debian_numeric_version "$(cat /etc/${rsource})") else rv=$( (grep VERSION "/etc/${rsource}"; cat "/etc/${rsource}") | grep '[0-9]' | sed -e 'q' ) fi @@ -1166,9 +1166,9 @@ __git_clone_and_checkout() { echodebug "Installed git version: $(git --version | awk '{ print $3 }')" - local __SALT_GIT_CHECKOUT_PARENT_DIR=$(dirname "${__SALT_GIT_CHECKOUT_DIR}" 2>/dev/null) + __SALT_GIT_CHECKOUT_PARENT_DIR=$(dirname "${__SALT_GIT_CHECKOUT_DIR}" 2>/dev/null) __SALT_GIT_CHECKOUT_PARENT_DIR="${__SALT_GIT_CHECKOUT_PARENT_DIR:-/tmp/git}" - local __SALT_CHECKOUT_REPONAME="$(basename "${__SALT_GIT_CHECKOUT_DIR}" 2>/dev/null)" + __SALT_CHECKOUT_REPONAME="$(basename "${__SALT_GIT_CHECKOUT_DIR}" 2>/dev/null)" __SALT_CHECKOUT_REPONAME="${__SALT_CHECKOUT_REPONAME:-salt}" [ -d "${__SALT_GIT_CHECKOUT_PARENT_DIR}" ] || mkdir "${__SALT_GIT_CHECKOUT_PARENT_DIR}" cd "${__SALT_GIT_CHECKOUT_PARENT_DIR}" @@ -1752,6 +1752,7 @@ install_ubuntu_deps() { else check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package 'requests'" __apt_get_install_noinput python-setuptools python-pip + # shellcheck disable=SC2089 __PIP_PACKAGES="'requests>=$_PY_REQUESTS_MIN_VERSION'" fi @@ -1984,6 +1985,7 @@ install_debian_deps() { check_pip_allowed "You need to allow pip based installations (-P) in order to install the python 'requests' package" # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 __PACKAGES="${__PACKAGES} python-pip" + # shellcheck disable=SC2089 __PIP_PACKAGES="${__PIP_PACKAGES} 'requests>=$_PY_REQUESTS_MIN_VERSION'" fi From 44e07adbb6dd84b9dda0ef264c792bffc8a7fb90 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 30 Apr 2015 14:45:30 +0100 Subject: [PATCH 59/75] Add Roman Inflianskas(@rominf) email address as requested. --- AUTHORS.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index c49c0cf..f05a12e 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -63,7 +63,7 @@ Pedro Paulo pedropaulovc ptonelli ptonelli Raymond Barbiero visualphoenix Roberto Aguilar rca roberto@baremetal.io -Roman Inflianskas rominf +Roman Inflianskas rominf infroma@gmail.com Ronald van Zantvoort The-Loeki ronald@pcextreme.nl Skyler Berg skylerberg skylertheberg@gmail.com Tate Eskew tateeskew From c09dfb7acfd919328d7d9fe74691ae12dc151f24 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 14:30:55 +0100 Subject: [PATCH 60/75] Install tornado on git installs for the develop branch if necessary Fixes #580 --- bootstrap-salt.sh | 137 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 134 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 203c196..aa598d9 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1821,6 +1821,18 @@ install_ubuntu_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" + if [ "$(which pip)" = "" ]; then + __apt_get_install_noinput python-setuptools python-pip + fi + pip install -U "'${__REQUIRED_TORNADO}'" + fi + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -2265,6 +2277,15 @@ install_debian_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" + pip install -U "'${__REQUIRED_TORNADO}'" + fi + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -2498,6 +2519,8 @@ install_fedora_deps() { __install_saltstack_copr_zeromq_repository || return 1 fi + __install_saltstack_copr_salt_repository || return 1 + __PACKAGES="yum-utils PyYAML libyaml m2crypto python-crypto python-jinja2 python-msgpack python-zmq python-requests" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then @@ -2561,6 +2584,14 @@ install_fedora_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + yum install -y python-tornado + fi + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -2689,7 +2720,7 @@ __install_saltstack_copr_zeromq_repository() { __REPOTYPE="epel" fi __fetch_url /etc/yum.repos.d/saltstack-zeromq4.repo \ - "http://copr.fedoraproject.org/coprs/saltstack/zeromq4/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/saltstack-zeromq4-${__REPOTYPE}-${DISTRO_MAJOR_VERSION}.repo" || return 1 + "http://copr.fedoraproject.org/coprs/saltstack/zeromq4/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/saltstack-zeromq4-${__REPOTYPE}-${DISTRO_MAJOR_VERSION}.repo" || return 1 fi return 0 } @@ -2702,17 +2733,45 @@ __install_saltstack_copr_salt_el5_repository() { return 0 } +__install_saltstack_copr_salt_repository() { + echoinfo "Adding SaltStack's COPR repository" + + if [ "${DISTRO_NAME_L}" = "fedora" ]; then + __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://copr.fedoraproject.org/coprs/saltstack/salt/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/${__REPO_FILENAME}" || return 1 + fi + return 0 +} + install_centos_stable_deps() { __install_epel_repository || return 1 if [ "$DISTRO_MAJOR_VERSION" -eq 5 ]; then __install_saltstack_copr_salt_el5_repository || return 1 fi + __install_saltstack_copr_salt_repository || return 1 + if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ] && [ "$DISTRO_MAJOR_VERSION" -gt 5 ]; then yum -y install python-hashlib || return 1 __install_saltstack_copr_zeromq_repository || return 1 fi + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + yum install -y python-tornado + fi + fi + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -2842,6 +2901,14 @@ install_centos_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + yum install -y python-tornado + fi + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -3426,6 +3493,7 @@ install_amazon_linux_ami_2010_git_deps() { install_amazon_linux_ami_deps() { # According to http://aws.amazon.com/amazon-linux-ami/faqs/#epel we should + # enable the EPEL 6 repo if [ "$CPU_ARCH_L" = "i686" ]; then EPEL_ARCH="i386" @@ -3434,6 +3502,14 @@ install_amazon_linux_ami_deps() { fi rpm -Uvh --force "http://mirrors.kernel.org/fedora-epel/6/${EPEL_ARCH}/epel-release-6-8.noarch.rpm" || return 1 + __REPO_FILENAME="saltstack-salt-epel-6.repo" + + if [ ! -s "/etc/yum.repos.d/${__REPO_FILENAME}" ]; then + echoinfo "Adding SaltStack's COPR repository" + __fetch_url /etc/yum.repos.d/${__REPO_FILENAME} \ + "http://copr.fedoraproject.org/coprs/saltstack/salt/repo/epel-6/${__REPO_FILENAME}" || return 1 + fi + if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then yum -y update || return 1 fi @@ -3470,6 +3546,15 @@ install_amazon_linux_ami_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + yum install -y python-tornado + fi + fi + + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -3565,6 +3650,15 @@ install_arch_linux_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + pacman -Sy --noconfirm --needed python2-tornado + fi + fi + + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -3820,6 +3914,14 @@ install_freebsd_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + fi + fi + echodebug "Adapting paths to FreeBSD" # The list of files was taken from Salt's BSD port Makefile for file in doc/man/salt-key.1 doc/man/salt-cp.1 doc/man/salt-minion.1 \ @@ -4007,6 +4109,18 @@ install_smartos_git_deps() { pkgin -y install scmgit || return 1 fi + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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")" + check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" + if [ "${__REQUIRED_TORNADO}" != "" ]; then + if [ "$(which pip)" = "" ]; then + pkgin -y install py27-pip + fi + pip install -U "'${__REQUIRED_TORNADO}'" + fi + fi + __git_clone_and_checkout || return 1 # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then @@ -4211,6 +4325,15 @@ install_opensuse_git_deps() { patch -p1 < pkg/suse/use-forking-daemon.patch || return 1 fi + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + __zypper_install python-tornado + fi + + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -4438,6 +4561,14 @@ install_suse_11_git_deps() { __git_clone_and_checkout || return 1 + if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then + # 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 + __zypper_install python-tornado + fi + fi + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then _TEMP_CONFIG_DIR="${__SALT_GIT_CHECKOUT_DIR}/conf/" @@ -4589,12 +4720,12 @@ __gentoo_post_dep() { install_gentoo_deps() { __gentoo_pre_dep || return 1 - __gentoo_post_dep + __gentoo_post_dep || return 1 } install_gentoo_git_deps() { __gentoo_pre_dep || return 1 - __gentoo_post_dep + __gentoo_post_dep || return 1 } install_gentoo_stable() { From 68f7867f29ff7c0d1820642cb4befcfe9628bebb Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 14:32:28 +0100 Subject: [PATCH 61/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2faad11..2e96d78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ Version 2015.xx.xx: * Fix openSUSE 13.2 where we need to pass --replaceflags. Thanks Roman Inflianskas(rominf). #504. * Make sure that a recent enough requests package is installed in Debian/Ubuntu. + * Install tornado on git installs for the develop branch if necessary. #580 Version 2015.03.15: From a3a901f28b9fb1c390b2c39b98de43c590940c42 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 14:43:12 +0100 Subject: [PATCH 62/75] Update supported distributions --- README.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index eba144d..95ddeae 100644 --- a/README.rst +++ b/README.rst @@ -319,21 +319,21 @@ Supported Operating Systems --------------------------- - Amazon Linux 2012.09 - Arch -- CentOS 5/6 -- Debian 6.x/7.x/8(git installations only) -- Fedora 17/18 +- CentOS 5/6/7 +- Debian 6/7/8 +- Fedora 17/18/20/21/22 - FreeBSD 9.1/9.2/10 - Gentoo - Linaro - Linux Mint 13/14 -- OpenSUSE 12.x +- OpenSUSE 12/13 - Oracle Linux 5/5 - Red Hat 5/6 - Red Hat Enterprise 5/6 - Scientific Linux 5/6 - SmartOS - SuSE 11 SP1/11 SP2 -- Ubuntu 10.x/11.x/12.x/13.04/13.10 +- Ubuntu 10.x/11.x/12.x/13.04/13.10/14.04/14.10 - Elementary OS 0.2 From 7430a7e9aa15b191fbc2988d6450cfc9d01ad69e Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 16:42:55 +0100 Subject: [PATCH 63/75] systemd-python is only available in CentOS 7/OL 7 --- bootstrap-salt.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index aa598d9..9dc3403 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2892,11 +2892,13 @@ install_centos_git_deps() { yum install -y git --enablerepo=${_EPEL_REPO} || return 1 fi fi - if [ "$DISTRO_NAME_L" = "oracle_linux" ]; then - # try both ways --enablerepo=X disables ALL OTHER REPOS!!!! - yum install -y systemd-python || yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 - else - yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 + + if [ "$DISTRO_MAJOR_VERSION" -gt 6 ]; then + if [ "$DISTRO_NAME_L" != "oracle_linux" ]; then + yum install -y systemd-python || yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 + else + yum install -y systemd-python --enablerepo=${_EPEL_REPO} || return 1 + fi fi __git_clone_and_checkout || return 1 From f16f63e1cd7923eca5d35d6ceb8ce2b18a7809db Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 19:12:31 +0100 Subject: [PATCH 64/75] Systemd service files changes paths in openSUSE 13.x --- bootstrap-salt.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9dc3403..c38959d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4400,7 +4400,11 @@ install_opensuse_git_post() { [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" + if [ "${DISTRO_MAJOR_VERSION}" -gt 12 ]; then + copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service" + else + copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" + fi continue fi From 49223835497df2c6a73ffbf6109b4c84481ab0f9 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 19:12:58 +0100 Subject: [PATCH 65/75] Fix inverse logic --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c38959d..e158d17 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4237,7 +4237,7 @@ __version_lte() { zypper zypper --non-interactive install --auto-agree-with-licenses python || return 1 fi - if [ "$(python -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1>=V2' "$1" "$2")" = "True" ]; then + if [ "$(python -c 'import sys; V1=tuple([int(i) for i in sys.argv[1].split(".")]); V2=tuple([int(i) for i in sys.argv[2].split(".")]); print V1<=V2' "$1" "$2")" = "True" ]; then __ZYPPER_REQUIRES_REPLACE_FILES=${BS_TRUE} else __ZYPPER_REQUIRES_REPLACE_FILES=${BS_FALSE} From 4edb996cc7997ef58fb75ffc0fd0b07a893fb666 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 19:15:00 +0100 Subject: [PATCH 66/75] systemd service files changed paths from 13.1 to 13.2!!!! --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index e158d17..72fce55 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4400,7 +4400,7 @@ install_opensuse_git_post() { [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue if [ -f /bin/systemctl ]; then - if [ "${DISTRO_MAJOR_VERSION}" -gt 12 ]; then + if [ "${DISTRO_MAJOR_VERSION}" -gt 13 ] || ([ "${DISTRO_MAJOR_VERSION}" -eq 13 ] && [ "${DISTRO_MINOR_VERSION}" -ge 2 ]); then copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/usr/lib/systemd/system/salt-${fname}.service" else copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" From ad8750b7a8fc915a8c996dda4c3982108399532c Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 21:34:01 +0100 Subject: [PATCH 67/75] Hard depend on requests on Debian --- bootstrap-salt.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 72fce55..2456913 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2169,12 +2169,17 @@ install_debian_7_deps() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 + + check_pip_allowed "You need to allow pip based installations (-P) in order to install requests" + __PACKAGES="build-essential python-dev python-pip" + # shellcheck disable=SC2086 + __apt_get_install_noinput ${__PACKAGES} || return 1 + pip install -U "'requests>=$_PY_REQUESTS_MIN_VERSION'" + + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then - check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud/requests" - __PACKAGES="build-essential python-dev python-pip" - # shellcheck disable=SC2086 - __apt_get_install_noinput ${__PACKAGES} || return 1 - pip install -U "'apache-libcloud>=$_LIBCLOUD_MIN_VERSION' 'requests>=$_PY_REQUESTS_MIN_VERSION'" + check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" + pip install -U "'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'" fi if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then From 6888df3e6444910099b1fe74c856a8ea818cee2a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 21:40:35 +0100 Subject: [PATCH 68/75] Remove inner quoting --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 2456913..151be93 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2174,12 +2174,12 @@ install_debian_7_deps() { __PACKAGES="build-essential python-dev python-pip" # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - pip install -U "'requests>=$_PY_REQUESTS_MIN_VERSION'" + pip install -U "requests>=$_PY_REQUESTS_MIN_VERSION" if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then check_pip_allowed "You need to allow pip based installations (-P) in order to install apache-libcloud" - pip install -U "'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'" + pip install -U "apache-libcloud>=$_LIBCLOUD_MIN_VERSION" fi if [ "$_UPGRADE_SYS" -eq $BS_TRUE ]; then From 9cad0cf57b78a03f43bde3940979d23834c18196 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 1 May 2015 21:46:58 +0100 Subject: [PATCH 69/75] Lint --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 151be93..ff36d98 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2750,7 +2750,7 @@ __install_saltstack_copr_salt_repository() { __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} \ + __fetch_url "/etc/yum.repos.d/${__REPO_FILENAME}" \ "http://copr.fedoraproject.org/coprs/saltstack/salt/repo/${__REPOTYPE}-${DISTRO_MAJOR_VERSION}/${__REPO_FILENAME}" || return 1 fi return 0 From acbd984204a00d2d2f989453d1be6d0272031d4d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 May 2015 15:43:58 +0100 Subject: [PATCH 70/75] Add support for Ubuntu 15.04 --- bootstrap-salt.sh | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ff36d98..f9c2440 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1741,7 +1741,7 @@ install_ubuntu_deps() { # Need python-apt for managing packages via Salt __apt_get_install_noinput python-apt - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 03 ]); then + if ([ "$DISTRO_MAJOR_VERSION" -gt 12 ] && [ "$DISTRO_MAJOR_VERSION" -lt 15 ]) || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 03 ]); then if [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]; then echoinfo "Installing ZMQ>=4/PyZMQ>=14 from Chris Lea's PPA repository" add-apt-repository -y ppa:chris-lea/zeromq || return 1 @@ -1749,11 +1749,13 @@ install_ubuntu_deps() { fi __apt_get_install_noinput python-requests __PIP_PACKAGES="" - else + elif [ "$DISTRO_MAJOR_VERSION" -lt 15 ]; then check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package 'requests'" __apt_get_install_noinput python-setuptools python-pip # shellcheck disable=SC2089 __PIP_PACKAGES="'requests>=$_PY_REQUESTS_MIN_VERSION'" + elif [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + __apt_get_install_noinput python-requests fi # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 @@ -1881,7 +1883,16 @@ install_ubuntu_git_post() { [ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /sbin/initctl ]; then + if [ -f /bin/systemctl ]; then + copyfile "${__SALT_GIT_CHECKOUT_DIR}/pkg/rpm/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 + [ $fname = "api" ] && continue + + systemctl is-enabled salt-$fname.service || (systemctl preset salt-$fname.service && systemctl enable salt-$fname.service) + sleep 0.1 + systemctl daemon-reload + elif [ -f /sbin/initctl ]; then _upstart_conf="/etc/init/salt-$fname.conf" # We have upstart support echodebug "There's upstart support" @@ -1913,6 +1924,7 @@ install_ubuntu_restart_daemons() { # Ensure upstart configs are loaded [ -f /sbin/initctl ] && /sbin/initctl reload-configuration + [ -f /bin/systemctl ] && systemctl daemon-reload for fname in minion master syndic api; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue @@ -1923,6 +1935,15 @@ install_ubuntu_restart_daemons() { #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue + if [ -f /bin/systemctl ]; then + echodebug "There's systemd support while checking salt-$fname" + systemctl stop salt-$fname > /dev/null 2>&1 + systemctl start salt-$fname.service + [ $? -eq 0 ] && continue + # We failed to start the service, let's test the SysV code below + echodebug "Failed to start salt-$fname using systemd" + fi + if [ -f /sbin/initctl ]; then echodebug "There's upstart support while checking salt-$fname" @@ -1958,7 +1979,10 @@ install_ubuntu_check_services() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue #[ $fname = "api" ] && ([ "$_INSTALL_MASTER" -eq $BS_FALSE ] || [ "$(which salt-${fname} 2>/dev/null)" = "" ]) && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then + + if [ -f /bin/systemctl ]; 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 elif [ -f /etc/init.d/salt-$fname ]; then __check_services_debian salt-$fname || return 1 From c40e6c2f868ab4968d706c2572622e3e5bca1f9a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 May 2015 15:44:24 +0100 Subject: [PATCH 71/75] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2e96d78..ef1ee76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ Version 2015.xx.xx: #504. * Make sure that a recent enough requests package is installed in Debian/Ubuntu. * Install tornado on git installs for the develop branch if necessary. #580 + * Add support for Ubuntu 15.04 Version 2015.03.15: From 981d85c2123fd7a2ae207adf07842c0cbbf29e7d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 May 2015 15:45:07 +0100 Subject: [PATCH 72/75] Update README because of the added Ubuntu 15.04 support --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0b2a787..78134c1 100644 --- a/README.rst +++ b/README.rst @@ -333,7 +333,7 @@ Supported Operating Systems - Scientific Linux 5/6 - SmartOS - SUSE Linux Enterprise 11 SP1/11 SP2/11 SP3 -- Ubuntu 10.x/11.x/12.x/13.04/13.10/14.04/14.10 +- Ubuntu 10.x/11.x/12.x/13.x/14.x/15.04 - Elementary OS 0.2 From bc0875b26c5227e99c7574d157ba830638300d87 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 May 2015 15:57:02 +0100 Subject: [PATCH 73/75] Add required variable into scope. Check for systemd first --- bootstrap-salt.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index f9c2440..afbbf95 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1756,6 +1756,7 @@ install_ubuntu_deps() { __PIP_PACKAGES="'requests>=$_PY_REQUESTS_MIN_VERSION'" elif [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then __apt_get_install_noinput python-requests + __PIP_PACKAGES="" fi # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 @@ -1923,8 +1924,11 @@ install_ubuntu_restart_daemons() { [ $_START_DAEMONS -eq $BS_FALSE ] && return # Ensure upstart configs are loaded - [ -f /sbin/initctl ] && /sbin/initctl reload-configuration - [ -f /bin/systemctl ] && systemctl daemon-reload + if [ -f /bin/systemctl ]; then + systemctl daemon-reload + elif [ -f /sbin/initctl ]; then + /sbin/initctl reload-configuration + fi for fname in minion master syndic api; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue From a140fbfc5982ee5cee663bd1784e86a2dcef3e07 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 3 May 2015 15:57:43 +0100 Subject: [PATCH 74/75] Systemd does not need that much sleep --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index afbbf95..116ee51 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1700,7 +1700,7 @@ __enable_universe_repository() { } install_ubuntu_deps() { - if [ "${__DEFAULT_SLEEP}" -eq "${__DEFAULT_SLEEP_ORIGINAL}" ]; then + if ([ "${__DEFAULT_SLEEP}" -eq "${__DEFAULT_SLEEP_ORIGINAL}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 15 ]); 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." From bd4dc0926fb9815f64353049faf294c81455769d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 4 May 2015 11:01:26 +0100 Subject: [PATCH 75/75] Bump version for stable release --- ChangeLog | 3 +-- bootstrap-salt.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef1ee76..4e76469 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Version 2015.xx.xx: +Version 2015.05.04: * Fix the configuration path for FreeBSD. #567/#552. Thanks Ronald van Zantvoort(The-Loeki). + Fix non grouping support in POSIX sed. Thanks Ronald van Zantvoort(The-Loeki). * Add Debian 8 support. Thanks Matt Black(mafrosis) @@ -13,7 +13,6 @@ Version 2015.xx.xx: * Install tornado on git installs for the develop branch if necessary. #580 * Add support for Ubuntu 15.04 - Version 2015.03.15: * Add multi-master support. Thanks Fred Reimer(freimer). #555 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 116ee51..78986e8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -17,7 +17,7 @@ # CREATED: 10/15/2012 09:49:37 PM WEST #====================================================================================================================== set -o nounset # Treat unset variables as an error -__ScriptVersion="2015.03.15" +__ScriptVersion="2015.05.04" __ScriptName="bootstrap-salt.sh" #======================================================================================================================