Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into stable for v2015…
Browse files Browse the repository at this point in the history
….07.22 release
  • Loading branch information
s0undt3ch committed Jul 22, 2015
2 parents 1370165 + 93e566c commit f8732ce
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 23 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ Vladimir Kozhukalov kozhukalov
Whit Morriss whitmo [email protected]
Wolodja Wentland babilen [email protected]
Wout wfhg
Yushi Nakai nyushi
========================== ===================== ============================
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 2015.07.22:
* Fix tornado installation in Ubuntu. Thanks Yushi Nakai. #627
* Install tornado using pip on Ubuntu for Salt's v2015.8.xx onward stable releases.
* Install requests on Ubuntu from Chris Lea's PPA. #630

Version 2015.07.17:
* Make sure setuptools is installed before using it. #598.
* `systemd` is only fully supported from 15.04 onwards. #602
Expand Down
10 changes: 5 additions & 5 deletions bootstrap-salt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ If ([IntPtr]::Size -eq 4) {
}

# Download minion setup file
Write-Host "Downloading Salt minion installer Salt-Minion-$version-$arch-Setup.exe"
Write-Host -NoNewline "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"
Write-Host -NoNewline "Installing Salt minion"
#Wait for process to exit before continuing.
C:\tmp\salt.exe /S /minion-name=$minion /master=$master | Out-Null

Expand Down Expand Up @@ -141,14 +141,14 @@ If($runservice) {
# 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"
Write-Host -NoNewline "Failed to start salt minion"
exit 1
}
}
Else {
Write-Host "Stopping salt minion and setting it to 'Manual'"
Write-Host -NoNewline "Stopping salt minion and setting it to 'Manual'"
Set-Service "salt-minion" -startupType "Manual"
Stop-Service "salt-minion"
}

Write-Host "Salt minion successfully installed"
Write-Host -NoNewline "Salt minion successfully installed"
57 changes: 39 additions & 18 deletions bootstrap-salt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# CREATED: 10/15/2012 09:49:37 PM WEST
#======================================================================================================================
set -o nounset # Treat unset variables as an error
__ScriptVersion="2015.07.17"
__ScriptVersion="2015.07.22"
__ScriptName="bootstrap-salt.sh"

#======================================================================================================================
Expand Down Expand Up @@ -426,8 +426,8 @@ elif [ "$ITYPE" = "stable" ]; then
STABLE_REV="latest"
else
__check_unparsed_options "$*"
if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5)$')" = "" ]; then
echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, latest)"
if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8)$')" = "" ]; then
echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, 2015.8, latest)"
exit 1
else
STABLE_REV="$1"
Expand Down Expand Up @@ -1758,39 +1758,50 @@ install_ubuntu_deps() {

__enable_universe_repository || return 1

__PIP_PACKAGES=""

# Minimal systems might not have upstart installed, install it
__apt_get_install_noinput upstart
__PACKAGES="upstart"

# Need python-apt for managing packages via Salt
__apt_get_install_noinput python-apt
__PACKAGES="${__PACKAGES} python-apt"

echoinfo "Installing Python Requests/Chardet from Chris Lea's PPA repository"
if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then
# Above Ubuntu 11.04 add a -y flag
add-apt-repository -y "ppa:chris-lea/python-requests" || return 1
add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1
else
add-apt-repository "ppa:chris-lea/python-requests" || return 1
add-apt-repository "ppa:chris-lea/python-chardet" || return 1
fi

__PACKAGES="${__PACKAGES} python-requests"

if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 03 ]); then
if ([ "$DISTRO_MAJOR_VERSION" -lt 15 ] && [ "$_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=""
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

# Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813
__apt_get_install_noinput procps pciutils || return 1
__PACKAGES="${__PACKAGES} procps pciutils"


if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
check_pip_allowed "You need to allow pip based installations (-P) in order to install 'apache-libcloud'"
if [ "${__PIP_PACKAGES}" = "" ]; then
__apt_get_install_noinput python-pip
if [ "$(which pip)" = "" ]; then
__PACKAGES="${__PACKAGES} python-setuptools python-pip"
fi
# shellcheck disable=SC2089
__PIP_PACKAGES="${__PIP_PACKAGES} 'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'"
fi

apt-get update
# shellcheck disable=SC2086,SC2090
__apt_get_install_noinput ${__PACKAGES} || return 1

if [ "${__PIP_PACKAGES}" != "" ]; then
# shellcheck disable=SC2086,SC2090
pip install -U ${__PIP_PACKAGES}
Expand Down Expand Up @@ -1828,6 +1839,16 @@ install_ubuntu_stable_deps() {
add-apt-repository "ppa:$STABLE_PPA" || return 1
fi

if [ ! "$(echo "$STABLE_REV" | egrep '^(2015\.8|latest)$')" = "" ]; then
# We need a recent tornado package
__REQUIRED_TORNADO="tornado >= 4.0"
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

apt-get update
}

Expand Down Expand Up @@ -1874,7 +1895,7 @@ install_ubuntu_git_deps() {
if [ "$(which pip)" = "" ]; then
__apt_get_install_noinput python-setuptools python-pip
fi
pip install -U "'${__REQUIRED_TORNADO}'"
pip install -U "${__REQUIRED_TORNADO}"
fi
fi

Expand Down Expand Up @@ -4226,7 +4247,7 @@ install_smartos_git_deps() {
if [ "$(which pip)" = "" ]; then
pkgin -y install py27-pip
fi
pip install -U "'${__REQUIRED_TORNADO}'"
pip install -U "${__REQUIRED_TORNADO}"
fi
fi

Expand Down

5 comments on commit f8732ce

@GregMSThompson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change has broken vagrant installations with Ubuntu and now requires an argument override in order to pass the -P for pip installation. If it is no longer possible to install salt stack with the setup script on ubuntu without pip surely the -P flag should just be assumed rather than the installation throwing an error?

@s0undt3ch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -P flag can be defaulted to true because the vast majority of sysadmins would hate for nom system packages to be installed without explicit consent.

We are aware of your problem and SaltStack is trying to make the necessary packages available to minimize this issue.

@GregMSThompson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks s0undt3ch, that makes sense. I've got a work around in for now and I appreciate all your efforts to resolve the issue.

Thanks again,
Greg

@s0undt3ch
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dam, my comment about should be can't be defaulted to true instead of can ...

@GregMSThompson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I assumed that was what you mean't :).

Please sign in to comment.