From 71f1e0bce3eae67e2c3694f1a036c7ac661278db Mon Sep 17 00:00:00 2001 From: Justin Findlay Date: Fri, 15 Apr 2016 13:32:42 -0600 Subject: [PATCH] workaround packages for non-LTS ubuntu --- bootstrap-salt.sh | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 5f0f916..8d74ec1 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2156,6 +2156,9 @@ install_ubuntu_deps() { # Minimal systems might not have upstart installed, install it __PACKAGES="upstart" + if [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + __PACKAGES="${__PACKAGES} python2.7" + fi if [ "$_VIRTUALENV_DIR" != "null" ]; then __PACKAGES="${__PACKAGES} python-virtualenv" fi @@ -2214,17 +2217,29 @@ install_ubuntu_stable_deps() { # Versions starting with 2015.5.6 and 2015.8.1 are hosted at repo.saltstack.com if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|latest|archive\/)')" != "" ]; then - # Saltstack's Stable Ubuntu repository + # Workaround for latest non-LTS ubuntu + if [ "$DISTRO_MAJOR_VERSION" -eq 15 ]; then + echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems" + UBUNTU_VERSION=14.04 + UBUNTU_CODENAME=trusty + else + UBUNTU_VERSION=$DISTRO_VERSION + UBUNTU_CODENAME=$DISTRO_CODENAME + fi + + # SaltStack's stable Ubuntu repository + SALTSTACK_UBUNTU_URL="${HTTP_VAL}://repo.saltstack.com/apt/ubuntu/$UBUNTU_VERSION/$repo_arch/$STABLE_REV" if [ "$(grep -ER 'latest .+ main' /etc/apt)" = "" ]; then - echo "deb http://repo.saltstack.com/apt/ubuntu/$DISTRO_VERSION/$repo_arch/$STABLE_REV $DISTRO_CODENAME main" > \ - "/etc/apt/sources.list.d/saltstack.list" + set +o nounset + echo "deb $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > "/etc/apt/sources.list.d/saltstack.list" + set -o nounset fi # Make sure wget is available __apt_get_install_noinput wget # shellcheck disable=SC2086 - wget $_WGET_ARGS -q $HTTP_VAL://repo.saltstack.com/apt/ubuntu/$DISTRO_VERSION/$repo_arch/$STABLE_REV/SALTSTACK-GPG-KEY.pub -O - | apt-key add - || return 1 + wget $_WGET_ARGS -q $SALTSTACK_UBUNTU_URL/SALTSTACK-GPG-KEY.pub -O - | apt-key add - || return 1 else # Alternate PPAs: salt16, salt17, salt2014-1, salt2014-7