From 4beaea754986e8b3392e04bfe0a409af7dd2621f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 8 May 2015 11:39:46 +0100 Subject: [PATCH 01/31] Make sure setuptools is installed before using it. Fixes #598 --- bootstrap-salt.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 8dd027a..97adda8 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2137,7 +2137,7 @@ _eof # We NEED to install the unstable dpkg or mime-support WILL fail to install __apt_get_install_noinput -t unstable dpkg liblzma5 python mime-support || return 1 __apt_get_install_noinput -t unstable libzmq3 libzmq3-dev || return 1 - __apt_get_install_noinput build-essential python-dev python-pip || return 1 + __apt_get_install_noinput build-essential python-dev python-pip python-setuptools || return 1 # Saltstack's Unstable Debian repository if [ "$(grep -R 'debian.saltstack.com' /etc/apt)" = "" ]; then @@ -2179,6 +2179,14 @@ _eof __apt_get_install_noinput python-zmq || return 1 + if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then + # Building pyzmq from source to build it against libzmq3. + # Should override current installation + # Using easy_install instead of pip because at least on Debian 6, + # there's no default virtualenv active. + easy_install -U pyzmq || return 1 + fi + if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 @@ -2380,7 +2388,7 @@ install_debian_6_git_deps() { install_debian_6_deps || return 1 if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then __PACKAGES="build-essential lsb-release python python-dev python-pkg-resources python-crypto" - __PACKAGES="${__PACKAGES} python-m2crypto python-yaml msgpack-python python-pip" + __PACKAGES="${__PACKAGES} python-m2crypto python-yaml msgpack-python python-pip python-setuptools" if [ "$(which git)" = "" ]; then __PACKAGES="${__PACKAGES} git" @@ -2435,14 +2443,6 @@ __install_debian_stable() { # shellcheck disable=SC2086 __apt_get_install_noinput ${__PACKAGES} || return 1 - if [ "$_PIP_ALLOWED" -eq $BS_TRUE ]; then - # Building pyzmq from source to build it against libzmq3. - # Should override current installation - # Using easy_install instead of pip because at least on Debian 6, - # there's no default virtualenv active. - easy_install -U pyzmq || return 1 - fi - return 0 } From f3efc30acb2bae8c57f2529c259eb658b2102ddf Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 8 May 2015 11:40:40 +0100 Subject: [PATCH 02/31] Update changes log --- ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1f5d7bb..ddd7352 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Version 2015.xx.xx: + * Make sure setuptools is installed before using it. #598. + Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. * Allow Ubuntu alternate ppas. Thanks Peter Tripp(notpeter). #563 From 3e98bec65235e9a2c45690185e549ed95d4ca5bd Mon Sep 17 00:00:00 2001 From: DenMat Date: Mon, 1 Sep 2014 21:21:29 +1000 Subject: [PATCH 03/31] PR: Issue 394 When using Vagrant and Docker the Salt provisioner would fail as Upstart is not running (and will most likely never be). The easiest way to fix this is to get Docker to drop a file onto the the filesystem (/tmp/disable_salt_checks) and then disable the service checks from that. Then to make it clear and optional from the command line I thought of adding the -d argument option to do the same thing. If either of these are present a warning message appears in the stdout. For a Dockerfile you would add: RUN touch /tmp/disable_salt_checks To run from the command line you would do: $ ./bootstrap-salt.sh -d This adds the following var (defaults to $BS_FALSE): _DISABLE_SALT_CHECKS --- bootstrap-salt.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 97adda8..7c7498b 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -211,6 +211,7 @@ _LIBCLOUD_MIN_VERSION="0.14.0" _PY_REQUESTS_MIN_VERSION="2.0" _EXTRA_PACKAGES="" _HTTP_PROXY="" +_DISABLE_SALT_CHECKS=$BS_FALSE __SALT_GIT_CHECKOUT_DIR=${BS_SALT_GIT_CHECKOUT_DIR:-/tmp/git/salt} @@ -277,6 +278,9 @@ usage() { -L Install the Apache Libcloud package if possible(required for salt-cloud) -p Extra-package to install while installing salt dependencies. One package per -p flag. You're responsible for providing the proper package name. + -d Disable check_service functions. Setting this flag disables the + 'install__check_services' checks. You can also do this by + touching /tmp/disable_salt_checks on the target host. Defaults \${BS_FALSE} -H Use the specified http proxy for the installation -Z Enable external software source for newer ZeroMQ(Only available for RHEL/CentOS/Fedora based distributions) @@ -284,7 +288,7 @@ EOT } # ---------- end of function usage ---------- -while getopts ":hvnDc:Gg:k:MSNXCPFUKIA:i:Lp:H:Z" opt +while getopts ":hvnDc:Gg:k:MSNXCPFUKIA:i:Lp:dH:Z" opt do case "${opt}" in @@ -333,6 +337,7 @@ do i ) _SALT_MINION_ID=$OPTARG ;; L ) _INSTALL_CLOUD=$BS_TRUE ;; p ) _EXTRA_PACKAGES="$_EXTRA_PACKAGES $OPTARG" ;; + d ) _DISABLE_SALT_CHECKS=$BS_TRUE ;; H ) _HTTP_PROXY="$OPTARG" ;; Z) _ENABLE_EXTERNAL_ZMQ_REPOS=$BS_TRUE ;; @@ -467,6 +472,12 @@ if [ "${CALLER}x" = "${0}x" ]; then CALLER="PIPED THROUGH" fi +# Work around for 'Docker + salt-bootstrap failure' https://github.com/saltstack/salt-bootstrap/issues/394 +if [ ${_DISABLE_SALT_CHECKS} -eq 0 ]; then + [ -f /tmp/disable_salt_checks ] && _DISABLE_SALT_CHECKS=$BS_TRUE && \ + echowarn "Found file: /tmp/disable_salt_checks, setting \$_DISABLE_SALT_CHECKS=true" +fi + echoinfo "${CALLER} ${0} -- Version ${__ScriptVersion}" echowarn "Running the unstable version of ${__ScriptName}" @@ -5166,12 +5177,17 @@ done echodebug "DAEMONS_RUNNING_FUNC=${DAEMONS_RUNNING_FUNC}" # Let's get the check services function -CHECK_SERVICES_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_check_services" -CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_check_services" -CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_check_services" -CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_check_services" -CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_${ITYPE}_check_services" -CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_check_services" +if [ ${_DISABLE_SALT_CHECKS} -eq $BS_FALSE ]; then + CHECK_SERVICES_FUNC_NAMES="install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_${ITYPE}_check_services" + CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_${ITYPE}_check_services" + CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}_check_services" + CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}${PREFIXED_DISTRO_MAJOR_VERSION}${PREFIXED_DISTRO_MINOR_VERSION}_check_services" + CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_${ITYPE}_check_services" + CHECK_SERVICES_FUNC_NAMES="$CHECK_SERVICES_FUNC_NAMES install_${DISTRO_NAME_L}_check_services" +else + CHECK_SERVICES_FUNC_NAMES=False + echowarn "DISABLE_SALT_CHECKS set, not setting \$CHECK_SERVICES_FUNC_NAMES" +fi CHECK_SERVICES_FUNC="null" for FUNC_NAME in $(__strip_duplicates "$CHECK_SERVICES_FUNC_NAMES"); do From 285c2353cc229f469186bf93434e4964b545c276 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 20 May 2015 18:20:34 +0100 Subject: [PATCH 04/31] `systemd` is only fully supported from 15.04 onwards Fixes #602 --- bootstrap-salt.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 97adda8..61bd433 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1915,7 +1915,7 @@ 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 /bin/systemctl ]; then + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; 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 @@ -1954,8 +1954,8 @@ install_ubuntu_git_post() { install_ubuntu_restart_daemons() { [ $_START_DAEMONS -eq $BS_FALSE ] && return - # Ensure upstart configs are loaded - if [ -f /bin/systemctl ]; then + # Ensure upstart configs / systemd units are loaded + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then systemctl daemon-reload elif [ -f /sbin/initctl ]; then /sbin/initctl reload-configuration @@ -1970,7 +1970,7 @@ 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 + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then echodebug "There's systemd support while checking salt-$fname" systemctl stop salt-$fname > /dev/null 2>&1 systemctl start salt-$fname.service @@ -2015,7 +2015,7 @@ install_ubuntu_check_services() { #[ $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 + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then __check_services_systemd salt-$fname || return 1 elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then __check_services_upstart salt-$fname || return 1 From 2fc2273bd504ad453869e4461748d7038d60cc44 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 20 May 2015 18:21:41 +0100 Subject: [PATCH 05/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index ddd7352..99df689 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Version 2015.xx.xx: * Make sure setuptools is installed before using it. #598. + * `systemd` is only fully supported from 15.04 onwards. #602 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From eb5f33bdcb683d91d5f6bb67b6d1bbe8fb9e0a19 Mon Sep 17 00:00:00 2001 From: Wolodja Wentland Date: Wed, 3 Jun 2015 12:33:50 +0200 Subject: [PATCH 06/31] Switch to httpredir.debian.org as default Debian mirror http.debian.net is now hosted on debian.org infrastructure under the name of httpredir.debian.org which also uses 302 redirects which allows users of Google DNS servers to use it. See https://lists.debian.org/debian-devel-announce/2015/05/msg00003.html for further information. --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 61bd433..a2ec9ad 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2218,7 +2218,7 @@ install_debian_7_deps() { # Debian Backports if [ "$(grep -R 'wheezy-backports' /etc/apt | grep -v "^#")" = "" ]; then - echo "deb http://http.debian.net/debian wheezy-backports main" >> \ + echo "deb http://httpredir.debian.org/debian wheezy-backports main" >> \ /etc/apt/sources.list.d/backports.list fi @@ -2286,7 +2286,7 @@ install_debian_8_deps() { # Debian Backports if [ "$(grep -R 'jessie-backports' /etc/apt | grep -v "^#")" = "" ]; then - echo "deb http://http.debian.net/debian jessie-backports main" >> \ + echo "deb http://httpredir.debian.org/debian jessie-backports main" >> \ /etc/apt/sources.list.d/backports.list fi From 894dd84489761d67d286eda6ce9c400fda7fc3b7 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 3 Jun 2015 18:15:45 +0100 Subject: [PATCH 07/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 99df689..3d99e06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ Version 2015.xx.xx: * Make sure setuptools is installed before using it. #598. * `systemd` is only fully supported from 15.04 onwards. #602 + * Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 8887751740677c3dbdda9152e211b947510a90c7 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 3 Jun 2015 18:16:25 +0100 Subject: [PATCH 08/31] Add Wolodja Wentland(@babilen) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 9943ca9..3553ac5 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -73,5 +73,6 @@ Tony Narlock tony Valentin Bud valentinbud valentin@databus.pro Vladimir Kozhukalov kozhukalov Whit Morriss whitmo whit@nocoast.us +Wolodja Wentland babilen w@babilen5.org Wout wfhg ========================== ===================== ============================ From 5a4176e1290b1aa8dc31f922fefd4c71de4fb0c3 Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Mon, 8 Jun 2015 11:23:17 +0200 Subject: [PATCH 09/31] Fix "STABLE_REV: unbound variable" On non Ubuntu systems, installing from a git reference (such as a branch name) failed with the following error 'line 1150: STABLE_REV: unbound variable' Fixes #599 --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a2ec9ad..fe4d550 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1147,7 +1147,7 @@ fi if ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$ITYPE" = "daily" ]); then echoerror "${DISTRO_NAME} does not have daily packages support" exit 1 -elif ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$STABLE_REV" != "latest" ]); then +elif ([ "${DISTRO_NAME_L}" != "ubuntu" ] && [ "$ITYPE" = "stable" ] && [ "$STABLE_REV" != "latest" ]); then echoerror "${DISTRO_NAME} does not have major version pegged packages support" exit 1 fi From 296b38370a0370e418ffe4d3391f2bd67b21cd25 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Tue, 23 Jun 2015 18:31:08 -0400 Subject: [PATCH 10/31] scmgit package outdated in pkgin, use git instead Since SmartOS pkgin 2013Q3 release, `scmgit` is depreciated. We're "strongly advised" to use `git` instead. For now, both yield same result. More info: https://github.com/joyent/pkgsrc-joyent/blob/master/scmgit/DESCR --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a2ec9ad..0ecc523 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4170,7 +4170,7 @@ install_smartos_git_deps() { install_smartos_deps || return 1 if [ "$(which git)" = "" ]; then - pkgin -y install scmgit || return 1 + pkgin -y install git || return 1 fi if [ -f "${__SALT_GIT_CHECKOUT_DIR}/requirements/base.txt" ]; then From 9acce13490c293ec36ee9981b8df6bc673124c84 Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Tue, 23 Jun 2015 18:59:35 -0400 Subject: [PATCH 11/31] SmartOS should install libcloud Based on https://github.com/saltstack/salt-bootstrap/issues/473 problem 2, and my own experience across dozens of SmartOS boxes, `libcloud` should be installed on SmartOS via `pkgin` to get salt working. --- bootstrap-salt.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a2ec9ad..f363311 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4156,6 +4156,10 @@ install_smartos_deps() { fi fi + if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then + pkgin -y install py27-apache-libcloud || return 1 + fi + if [ "${_EXTRA_PACKAGES}" != "" ]; then echoinfo "Installing the following extra packages as requested: ${_EXTRA_PACKAGES}" # shellcheck disable=SC2086 From e320bcf8e044e11da7175e410945a9c17afb7708 Mon Sep 17 00:00:00 2001 From: Pat O'Shea Date: Tue, 7 Jul 2015 21:34:57 -0600 Subject: [PATCH 12/31] Windows bootstrap script This will install a minion locally on windows. Option parameters will accept version, minion id, master id, and a flag for stopping and setting the salt-minion service to manual for local testing. Passing in a verbose flag will increase logging. Finally, help is displayed via man ./bootstrap-salt.ps1 help ./bootstrap-salt.ps1 --- bootstrap-salt.ps1 | 154 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 bootstrap-salt.ps1 diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 new file mode 100644 index 0000000..36c50b0 --- /dev/null +++ b/bootstrap-salt.ps1 @@ -0,0 +1,154 @@ +<# +.SYNOPSIS +A simple Powershell script to download and install a salt minion on windows. +.DESCRIPTION +The script will download the official salt package from saltstack. It will install a specific +package version and accept parameters for the master and minion ids. Finally, it can stop and +set the windows service to "manual" for local testing. +.EXAMPLE +./bootstrap-salt.ps1 +Runs without any parameters. Uses all the default values/settings. +.EXAMPLE +./bootstrap-salt.ps1 -version 2015.4.1-3 +Specifies a particular version of the installer. +.EXAMPLE +./bootstrap-salt.ps1 -runservice false +Specifies the salt-minion service to stop and be set to manual. +Useful for testing locally from the command line with the --local switch +.EXAMPLE +./bootstrap-salt.ps1 -minion minion-box -master master-box +Specifies the minion and master ids in the minion config. +Defaults to the installer values of "minion" and "master". +.EXAMPLE +./bootstrap-salt.ps1 -minion minion-box -master master-box -version 2015.5.2 -runservice false +Specifies all the optional parameters in no particular order. +.PARAMETER version - Default version defined in this script. + +.PARAMETER runservice - Boolean flag to stop the windows service and set to "manual". + Installer starts it by default. + +.PARAMETER minion - Name of the minion being installed on this host. + Installer defaults to "minion". + +.PARAMETER master - Name or IP of the master server the minion. Installer defaults to "master". + +.NOTES +All of the parameters are optional. The default should be the latest version. The architecture +is dynamically determined by the script. + +.LINK +Bootstrap GitHub Project (script home) - https://github.com/saltstack/salt-windows-bootstrap +Original Vagrant Provisioner Project -https://github.com/saltstack/salty-vagrant +Vagrant Project (utilizes this script) - https://github.com/mitchellh/vagrant +SaltStack Download Location - http://docs.saltstack.com/downloads/ +#> +[CmdletBinding()] +Param( + [Parameter(Mandatory=$false,ValueFromPipeline=$true)] + # Doesn't support versions prior to "YYYY.M.R-B" + [ValidatePattern('^(201[0-9]\.[0-9]\.[0-9](\-\d{1})?)$')] + [string]$version = "2015.5.2", + + [Parameter(Mandatory=$false,ValueFromPipeline=$true)] + [ValidateSet("true","false")] + [string]$runservice = "true", + + [Parameter(Mandatory=$false,ValueFromPipeline=$true)] + [string]$minion = "salt-minion", + + [Parameter(Mandatory=$false,ValueFromPipeline=$true)] + [string]$master = "master" +) + +Write-Verbose "Parameters passed in:" +Write-Verbose "version: $version" +Write-Verbose "runservice: $runservice" +Write-Verbose "master: $master" +Write-Verbose "minion: $minion" + +If ($runservice.ToLower() -eq "true"){ + Write-Verbose "Windows service will be set to run" + [bool]$runservice = $True +} +ElseIf ($runservice.ToLower() -eq "false"){ + Write-Verbose "Windows service will be stopped and set to manual" + [bool]$runservice = $False +} +Else { + # Param passed in wasn't clear so defaulting to true. + Write-Verbose "Windows service defaulting to run automatically" + [bool]$runservice = $True +} + +# Create C:\tmp\ - if Vagrant doesn't upload keys and/or config it might not exist +New-Item C:\tmp\ -ItemType directory -force | out-null + +# Copy minion keys & config to correct location +New-Item C:\salt\conf\pki\minion\ -ItemType directory -force | out-null + +# Check if minion keys have been uploaded +If (Test-Path C:\tmp\minion.pem) { + cp C:\tmp\minion.pem C:\salt\conf\pki\minion\ + cp C:\tmp\minion.pub C:\salt\conf\pki\minion\ +} + +# Detect architecture +If ([IntPtr]::Size -eq 4) { + $arch = "x86" +} Else { + $arch = "AMD64" +} + +# Download minion setup file +Write-Host "Downloading Salt minion installer Salt-Minion-$version-$arch-Setup.exe" +$webclient = New-Object System.Net.WebClient +$url = "https://docs.saltstack.com/downloads/Salt-Minion-$version-$arch-Setup.exe" +$file = "C:\tmp\salt.exe" +$webclient.DownloadFile($url, $file) + +# Install minion silently +Write-Host "Installing Salt minion" +#Wait for process to exit before continuing. +C:\tmp\salt.exe /S /minion-name=$minion /master=$master | Out-Null + + +# Check if minion config has been uploaded +If (Test-Path C:\tmp\minion) { + cp C:\tmp\minion C:\salt\conf\ +} + +# Wait for salt-minion service to be registered before trying to start it +$service = Get-Service salt-minion -ErrorAction SilentlyContinue +While (!$service) { + Start-Sleep -s 2 + $service = Get-Service salt-minion -ErrorAction SilentlyContinue +} + +If($runservice) { + # Start service + Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue + + # Check if service is started, otherwise retry starting the + # service 4 times. + $try = 0 + While (($service.Status -ne "Running") -and ($try -ne 4)) { + Start-Service -Name "salt-minion" -ErrorAction SilentlyContinue + $service = Get-Service salt-minion -ErrorAction SilentlyContinue + Start-Sleep -s 2 + $try += 1 + } + + # If the salt-minion service is still not running, something probably + # went wrong and user intervention is required - report failure. + If ($service.Status -eq "Stopped") { + Write-Host "Failed to start salt minion" + exit 1 + } +} +Else { + Write-Host "Stopping salt minion and setting it to 'Manual'" + Set-Service "salt-minion" -startupType "Manual" + Stop-Service "salt-minion" +} + +Write-Host "Salt minion successfully installed" From 44ab861409f18fe49d21dca6ef208047d3e71ae2 Mon Sep 17 00:00:00 2001 From: Ethan Moore Date: Sat, 11 Jul 2015 14:14:00 +0000 Subject: [PATCH 13/31] python-jinja2 has been moved to rhui-...server-releases-optional repo in EC2's RHUI for RHEL6 --- bootstrap-salt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 09461b9..9498a21 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3153,6 +3153,9 @@ __test_rhel_optionals_packages() { fi if [ "$DISTRO_MAJOR_VERSION" -ge 6 ]; then + #python-jinja2 is in repo server-releases-optional in EC2/RHEL6 + yum-config-manager --enable rhui-\*-server-releases-optional || return 1 + # Let's enable package installation testing, kind of, --dry-run echoinfo "Testing if packages usually on the optionals repository are available:" __YUM_CONF_DIR="$(mktemp -d)" From b9887794b2186ef07987b2e963248d0c0e977794 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 13 Jul 2015 16:40:57 +0100 Subject: [PATCH 14/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 3d99e06..e03e2f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ Version 2015.xx.xx: * Make sure setuptools is installed before using it. #598. * `systemd` is only fully supported from 15.04 onwards. #602 * Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606 + * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe #621 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 3ba9e5a21cb3071df5fbf7d9dbe66613840be109 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 13 Jul 2015 16:41:04 +0100 Subject: [PATCH 15/31] Add @lomeroe to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 3553ac5..6a99ff4 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -41,6 +41,7 @@ Jeff Strunk jstrunk Juan A. Moyano wincus wincus.public@gmail.com Karl Grzeszczak karlgrz Kenneth Wilke KennethWilke +lomeroe lomeroe Liu Xiaohui oreh herolxh@gmail.com Mark Lee malept markgaylard markgaylard From 3a72a401500b51c822adfc4ceb71fb1a4cb16b45 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 13 Jul 2015 16:48:38 +0100 Subject: [PATCH 16/31] Update changes log --- ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e03e2f9..ae1495a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,8 @@ Version 2015.xx.xx: * Make sure setuptools is installed before using it. #598. * `systemd` is only fully supported from 15.04 onwards. #602 * Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606 - * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe #621 + * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe. #621 + * Allow skipping services. Thanks denmat. #455 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 29572ae97fdac63fa3f4e6655892c3464b90855f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Mon, 13 Jul 2015 16:49:40 +0100 Subject: [PATCH 17/31] Add @denmat to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 6a99ff4..f0a236b 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -18,6 +18,7 @@ C. R. Oldham cro cr@saltstack.com Cam camereonsparr Chris Rebert cvrebert chris.rebert@hulu.com Christer Edwards cedwards +denmat denmat Dag Viggo Lokøen dagvl dag.viggo@lokoen.org Dan Mick dmick dan.mick@inktank.com David J. Felix DavidJFelix From f63c8fb2826d1324a3377dbc9445d1ca7c76a75f Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Tue, 14 Jul 2015 14:48:12 +0100 Subject: [PATCH 18/31] Make sure yum-utils is installed before using it. Fixes #622 Closes #623 --- bootstrap-salt.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9498a21..a328cf9 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -3148,6 +3148,9 @@ install_centos_check_services() { __test_rhel_optionals_packages() { __install_epel_repository || return 1 + # Make sure yum-utils is installed + yum list installed yum-utils > /dev/null 2>&1 || yum -y install yum-utils --enablerepo=${_EPEL_REPO} || return 1 + if [ "$DISTRO_MAJOR_VERSION" -ge 7 ]; then yum-config-manager --enable \*server-optional || return 1 fi From d4a48c22936e1a2b5b39d7fad74ccc2875fc72bb Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Wed, 15 Jul 2015 22:09:06 -0400 Subject: [PATCH 19/31] fix config and etc path on SmartOS --- bootstrap-salt.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a328cf9..200d3f7 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4154,6 +4154,11 @@ install_freebsd_restart_daemons() { install_smartos_deps() { pkgin -y install zeromq py27-m2crypto py27-crypto py27-msgpack py27-yaml py27-jinja2 py27-zmq py27-requests || return 1 + # Set _SALT_ETC_DIR to SmartOS default if they didn't specify + _SALT_ETC_DIR=${BS_SALT_ETC_DIR:-/opt/local/etc/salt} + # We also need to redefine the PKI directory + _PKI_DIR=${_SALT_ETC_DIR}/pki + # Let's trigger config_salt() if [ "$_TEMP_CONFIG_DIR" = "null" ]; then # Let's set the configuration directory to /tmp @@ -4223,7 +4228,8 @@ install_smartos_stable() { install_smartos_git() { # Use setuptools in order to also install dependencies - USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install || return 1 + # lets force our config path on the setup for now, since salt/syspaths.py only got fixed in 2015.5.0 + USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1 return 0 } From f59b332fb717f384bc88af4122f76c5a43de2abf Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 16 Jul 2015 19:51:04 +0100 Subject: [PATCH 20/31] Fix missing Debian init script If the init script is not found in the checked out source, download it from the git repository when Sal't debian packaging comes from. Fixes #607 Fixes saltstack/salt#25270 Fixes saltstack/salt#25456 --- bootstrap-salt.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a328cf9..a9cc2ef 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2520,6 +2520,8 @@ install_debian_git_post() { 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" + else + __fetch_url "/etc/init.d/salt-$fname" "http://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init" fi if [ ! -f "/etc/init.d/salt-$fname" ]; then echowarn "The init script for salt-$fname was not found, skipping it..." From 2fba0b654eaa787f2b6fd80a2fe335246b9e931e Mon Sep 17 00:00:00 2001 From: Bret Fisher Date: Thu, 16 Jul 2015 15:28:05 -0400 Subject: [PATCH 21/31] salt-config-dir before and after install smartos --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 200d3f7..afc41e7 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4229,7 +4229,7 @@ install_smartos_stable() { install_smartos_git() { # Use setuptools in order to also install dependencies # lets force our config path on the setup for now, since salt/syspaths.py only got fixed in 2015.5.0 - USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1 ++++ USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || USE_SETUPTOOLS=1 /opt/local/bin/python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 return 0 } From 8a9772efe0e7dcd4373e3f9f9eb1c8f44acd179d Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 16 Jul 2015 21:04:24 +0100 Subject: [PATCH 22/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index ae1495a..24d5f97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Version 2015.xx.xx: * Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606 * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe. #621 * Allow skipping services. Thanks denmat. #455 + * Fix missing Debian init script. #607 saltstack/salt#25270 and saltstack/salt#25456 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 78bea9a2f2fc7405fd0050a4abb4975ff61fced4 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 16 Jul 2015 21:13:20 +0100 Subject: [PATCH 23/31] Also support Salt's setup.py global options --- bootstrap-salt.sh | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ad4925c..a5e080d 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1910,7 +1910,8 @@ install_ubuntu_daily() { install_ubuntu_git() { if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || return 1 + python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || \ + python setup.py --salt-config-dir="$_SALT_ETC_DIR" install --install-layout=deb || return 1 else python setup.py install --install-layout=deb || return 1 fi @@ -2476,7 +2477,8 @@ install_debian_8_stable() { install_debian_git() { if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || return 1 + python setup.py install --install-layout=deb --salt-config-dir="$_SALT_ETC_DIR" || \ + python setup.py --salt-config-dir="$_SALT_ETC_DIR" install --install-layout=deb || return 1 else python setup.py install --install-layout=deb || return 1 fi @@ -2521,7 +2523,7 @@ install_debian_git_post() { 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" else - __fetch_url "/etc/init.d/salt-$fname" "http://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init" + __fetch_url "/etc/init.d/salt-$fname" "http://anonscm.debian.org/cgit/pkg-salt/salt.git/plain/debian/salt-${fname}.init" fi if [ ! -f "/etc/init.d/salt-$fname" ]; then echowarn "The init script for salt-$fname was not found, skipping it..." @@ -2678,7 +2680,8 @@ install_fedora_git_deps() { install_fedora_git() { if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1 + python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \ + python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 else python setup.py install || return 1 fi @@ -3002,7 +3005,8 @@ install_centos_git() { _PYEXE=python2 fi if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - $_PYEXE setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1 + $_PYEXE setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \ + $_PYEXE setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 else $_PYEXE setup.py install || return 1 fi @@ -3765,7 +3769,8 @@ install_arch_linux_stable() { install_arch_linux_git() { if [ -f "${__SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then - python2 setup.py install --salt-config-dir="$_SALT_ETC_DIR" || return 1 + python2 setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \ + python2 setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 else python2 setup.py install || return 1 fi @@ -4079,6 +4084,17 @@ install_freebsd_git() { --salt-base-master-roots-dir="${_SALT_ETC_DIR}/salt-master" \ --salt-logs-dir=/var/log/salt \ --salt-pidfile-dir=/var/run \ + || /usr/local/bin/python2 setup.py \ + --salt-root-dir=/usr/local \ + --salt-config-dir="${_SALT_ETC_DIR}" \ + --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-logs-dir=/var/log/salt \ + --salt-pidfile-dir=/var/run install \ || return 1 fi @@ -4231,7 +4247,8 @@ install_smartos_stable() { install_smartos_git() { # Use setuptools in order to also install dependencies # lets force our config path on the setup for now, since salt/syspaths.py only got fixed in 2015.5.0 -+++ USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || USE_SETUPTOOLS=1 /opt/local/bin/python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 + USE_SETUPTOOLS=1 /opt/local/bin/python setup.py install --salt-config-dir="$_SALT_ETC_DIR" || \ + USE_SETUPTOOLS=1 /opt/local/bin/python setup.py --salt-config-dir="$_SALT_ETC_DIR" install || return 1 return 0 } From b879a1d83266faa330e1d78ec1f3d02e0ad0d141 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 16 Jul 2015 21:14:26 +0100 Subject: [PATCH 24/31] Add Bret Fisher(@BretFisher) to AUTHORS --- AUTHORS.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index f0a236b..d99284e 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -13,6 +13,7 @@ Angelo Gründler plueschopath angelo.gruendler@w1r3.net Ari Aosved devaos ari.aosved@gmail.com Boris Feld Lothiraldan Brad Thurber bradthurber +Bret Fisher BretFisher bret@fishbrains.com bruce-one bruce-one C. R. Oldham cro cr@saltstack.com Cam camereonsparr From 9e4b3759d721b5d98121ef61196459419712888b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Thu, 16 Jul 2015 21:15:29 +0100 Subject: [PATCH 25/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 24d5f97..6735a53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Version 2015.xx.xx: * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe. #621 * Allow skipping services. Thanks denmat. #455 * Fix missing Debian init script. #607 saltstack/salt#25270 and saltstack/salt#25456 + * Fix SmartOS etc path. Thanks Bret Fisher. #624. Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From a708203bf024b148b9f5117d86e8e96e956f9488 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 11:10:07 +0100 Subject: [PATCH 26/31] Readme clarification. Fixes #620 --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 78134c1..527b3fd 100644 --- a/README.rst +++ b/README.rst @@ -61,6 +61,9 @@ Install a specific version from git using ``wget``: wget -O install_salt.sh https://bootstrap.saltstack.com sudo sh install_salt.sh -P git v0.16.4 +On the above example we added `-P` which will allow PIP packages to be installed if required but +it's no a necessary flag for git based bootstraps. + If you already have python installed, ``python 2.6``, then it's as easy as: From 497009c8b491ccd10508187acf82621e26a7020b Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 11:21:46 +0100 Subject: [PATCH 27/31] Fix possible unbound variable in Gentoo. Closes #625. --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index a5e080d..c8f9210 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4788,7 +4788,7 @@ __gentoo_config_protection() { # this point, manually merge the changes using etc-update/dispatch-conf/ # cfg-update and then restart the bootstrapping script, so instead we allow # at this point to modify certain config files directly - export CONFIG_PROTECT_MASK="$CONFIG_PROTECT_MASK /etc/portage/package.keywords /etc/portage/package.unmask /etc/portage/package.use /etc/portage/package.license" + export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK:-} /etc/portage/package.keywords /etc/portage/package.unmask /etc/portage/package.use /etc/portage/package.license" } __gentoo_pre_dep() { From 453185f017d734dbeb0c4d567268e34558b51eb2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 11:22:39 +0100 Subject: [PATCH 28/31] Update changes log --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 6735a53..af8cdda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Version 2015.xx.xx: * Allow skipping services. Thanks denmat. #455 * Fix missing Debian init script. #607 saltstack/salt#25270 and saltstack/salt#25456 * Fix SmartOS etc path. Thanks Bret Fisher. #624. + * Fix possible unbound variable in Gentoo. #625. Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 40cb0cd03a1207fde805e7167ad529bd7dc98983 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 11:32:03 +0100 Subject: [PATCH 29/31] Properly detect the git binary in SmartOS. Fixes #611 --- bootstrap-salt.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index c8f9210..9298b2c 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -4213,7 +4213,8 @@ install_smartos_deps() { install_smartos_git_deps() { install_smartos_deps || return 1 - if [ "$(which git)" = "" ]; then + which git > /dev/null 2>&1 + if [ $? -eq 1 ]; then pkgin -y install git || return 1 fi From f10283d93822dc5f1a8761e6925d917a80f29644 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 11:32:45 +0100 Subject: [PATCH 30/31] Update changes log --- ChangeLog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index af8cdda..cd4ed64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,8 +5,9 @@ Version 2015.xx.xx: * Fix python-jinja2 repo move on RHEL6. Thanks lomeroe. #621 * Allow skipping services. Thanks denmat. #455 * Fix missing Debian init script. #607 saltstack/salt#25270 and saltstack/salt#25456 - * Fix SmartOS etc path. Thanks Bret Fisher. #624. - * Fix possible unbound variable in Gentoo. #625. + * Fix SmartOS etc path. Thanks Bret Fisher. #624 + * Fix possible unbound variable in Gentoo. #625 + * Properly detect the git binary in SmartOS. #611 Version 2015.05.07: * Lower required requests version dependency. Use system requests package where possible. From 7b706dbece79ef164bf00b153bd0d7030d5dac4a Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Fri, 17 Jul 2015 12:12:39 +0100 Subject: [PATCH 31/31] Bump version for stable release --- ChangeLog | 2 +- bootstrap-salt.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd4ed64..14dc60e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Version 2015.xx.xx: +Version 2015.07.17: * Make sure setuptools is installed before using it. #598. * `systemd` is only fully supported from 15.04 onwards. #602 * Fix debian mirrors issue. Thanks Wolodja Wentland(babilen). #606 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 9298b2c..2322298 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.05.07" +__ScriptVersion="2015.07.17" __ScriptName="bootstrap-salt.sh" #======================================================================================================================