From 75b3eb32b8cfd62a24a4a8ec7afef27499f1c538 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 10:20:03 -0700 Subject: [PATCH 1/8] Updated supported versions for Ubuntu: 12.04, 14.04, 16.04, and 16.10 (best effort) The bootstrap script should match the supported versions of SaltStack more closely, and we don't support versions that are considered EOL by the OS distributors themselves. This change updates the bootstrap script to support Ubuntu 12.04, 14.04, 16.04, and 16.10 (which the .10 release is a "best-effort" support since it is a non-LTS OS release from Ubuntu). --- README.rst | 2 +- bootstrap-salt.sh | 75 ++++++++++++++++------------------------------- 2 files changed, 26 insertions(+), 51 deletions(-) diff --git a/README.rst b/README.rst index 41b4d78..c31058e 100644 --- a/README.rst +++ b/README.rst @@ -253,7 +253,7 @@ Ubuntu and derivatives - Linaro 12.04 - Linux Mint 13/14/16/17/18 - Trisquel GNU/Linux 6 (based on Ubuntu 12.04) -- Ubuntu 10.x/11.x/12.x/13.x/14.x/15.x/16.04 +- Ubuntu 12.04/14.04/16.04 Other Linux distro diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 696c8f7..23b87df 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1707,7 +1707,12 @@ __check_end_of_life_versions() { # Ubuntu versions not supported # # < 12.04 - if [ "$DISTRO_MAJOR_VERSION" -lt 12 ]; then + # 13.x, 15.x + # 12.10, 14.10 + if [ "$DISTRO_MAJOR_VERSION" -lt 12 ] || \ + [ "$DISTRO_MAJOR_VERSION" -eq 13 ] || \ + [ "$DISTRO_MAJOR_VERSION" -eq 15 ] || \ + ([ "$DISTRO_MAJOR_VERSION" -lt 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then echoerror "End of life distributions are not supported." echoerror "Please consider upgrading to the next stable. See:" echoerror " https://wiki.ubuntu.com/Releases" @@ -2303,13 +2308,8 @@ __enable_universe_repository() { echodebug "Enabling the universe repository" # Ubuntu versions higher than 12.04 do not live in the old repositories - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then + if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 - elif [ "$DISTRO_MAJOR_VERSION" -lt 11 ] && [ "$DISTRO_MINOR_VERSION" -lt 10 ]; then - # Below Ubuntu 11.10, the -y flag to add-apt-repository is not supported - add-apt-repository "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 - else - add-apt-repository -y "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 fi add-apt-repository -y "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 @@ -2318,7 +2318,7 @@ __enable_universe_repository() { } install_ubuntu_deps() { - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]); then + if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then # Above Ubuntu 12.04 add-apt-repository is in a different package __apt_get_install_noinput software-properties-common || return 1 else @@ -2332,18 +2332,10 @@ install_ubuntu_deps() { if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" = "" ]; then if [ "$DISTRO_MAJOR_VERSION" -lt 14 ]; then echoinfo "Installing Python Requests/Chardet from Chris Lea's PPA repository" - if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then - # Above Ubuntu 11.04 add a -y flag - add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 - add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1 - add-apt-repository -y "ppa:chris-lea/python-urllib3" || return 1 - add-apt-repository -y "ppa:chris-lea/python-crypto" || return 1 - else - add-apt-repository "ppa:chris-lea/python-requests" || return 1 - add-apt-repository "ppa:chris-lea/python-chardet" || return 1 - add-apt-repository "ppa:chris-lea/python-urllib3" || return 1 - add-apt-repository "ppa:chris-lea/python-crypto" || return 1 - fi + add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 + add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1 + add-apt-repository -y "ppa:chris-lea/python-urllib3" || return 1 + add-apt-repository -y "ppa:chris-lea/python-crypto" || return 1 fi fi @@ -2354,7 +2346,7 @@ install_ubuntu_deps() { # Minimal systems might not have upstart installed, install it __PACKAGES="upstart" - if [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then __PACKAGES="${__PACKAGES} python2.7" fi if [ "$_VIRTUALENV_DIR" != "null" ]; then @@ -2385,7 +2377,7 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - if ([ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 15 ]); then + if ([ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]); then # The user did not pass a custom sleep value as an argument, let's increase the default value echodebug "On Ubuntu systems we increase the default sleep value to 10." echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." @@ -2430,10 +2422,10 @@ install_ubuntu_stable_deps() { # Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" != "" ]; then # Workaround for latest non-LTS ubuntu - if [ "$DISTRO_MAJOR_VERSION" -eq 15 ]; then + if [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." - UBUNTU_VERSION=14.04 - UBUNTU_CODENAME=trusty + UBUNTU_VERSION=16.04 + UBUNTU_CODENAME=xenial else UBUNTU_VERSION=$DISTRO_VERSION UBUNTU_CODENAME=$DISTRO_CODENAME @@ -2459,12 +2451,7 @@ install_ubuntu_stable_deps() { STABLE_PPA="saltstack/salt" fi - if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then - # Above Ubuntu 11.04 add a -y flag - add-apt-repository -y "ppa:$STABLE_PPA" || return 1 - else - add-apt-repository "ppa:$STABLE_PPA" || return 1 - fi + add-apt-repository -y "ppa:$STABLE_PPA" || return 1 fi apt-get update @@ -2476,24 +2463,12 @@ install_ubuntu_stable_deps() { install_ubuntu_daily_deps() { install_ubuntu_stable_deps || return 1 - if [ "$DISTRO_MAJOR_VERSION" -ge 12 ]; then - # Above Ubuntu 11.10 add-apt-repository is in a different package - __apt_get_install_noinput software-properties-common || return 1 - else - __apt_get_install_noinput python-software-properties || return 1 - fi + __apt_get_install_noinput software-properties-common || return 1 if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then __enable_universe_repository || return 1 - # for anything up to and including 11.04 do not use the -y option - if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then - # Above Ubuntu 11.04 add a -y flag - add-apt-repository -y ppa:saltstack/salt-daily || return 1 - else - add-apt-repository ppa:saltstack/salt-daily || return 1 - fi - + add-apt-repository -y ppa:saltstack/salt-daily || return 1 apt-get update fi @@ -2599,7 +2574,7 @@ install_ubuntu_git() { install_ubuntu_stable_post() { # Workaround for latest LTS packages on latest ubuntu. Normally packages on # debian-based systems will automatically start the corresponding daemons - if [ "$DISTRO_MAJOR_VERSION" -lt 15 ]; then + if [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then return 0 fi @@ -2635,7 +2610,7 @@ install_ubuntu_git_post() { [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then __copyfile "${_SALT_GIT_CHECKOUT_DIR}/pkg/deb/salt-${fname}.service" "/lib/systemd/system/salt-${fname}.service" # Skip salt-api since the service should be opt-in and not necessarily started on boot @@ -2680,7 +2655,7 @@ install_ubuntu_restart_daemons() { [ $_START_DAEMONS -eq $BS_FALSE ] && return # Ensure upstart configs / systemd units are loaded - if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then systemctl daemon-reload elif [ -f /sbin/initctl ]; then /sbin/initctl reload-configuration @@ -2695,7 +2670,7 @@ install_ubuntu_restart_daemons() { [ $fname = "minion" ] && [ "$_INSTALL_MINION" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then echodebug "There's systemd support while checking salt-$fname" systemctl stop salt-$fname > /dev/null 2>&1 systemctl start salt-$fname.service @@ -2739,7 +2714,7 @@ install_ubuntu_check_services() { [ $fname = "master" ] && [ "$_INSTALL_MASTER" -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ "$_INSTALL_SYNDIC" -eq $BS_FALSE ] && continue - if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 15 ]; then + if [ -f /bin/systemctl ] && [ "$DISTRO_MAJOR_VERSION" -ge 16 ]; then __check_services_systemd salt-$fname || return 1 elif [ -f /sbin/initctl ] && [ -f /etc/init/salt-${fname}.conf ]; then __check_services_upstart salt-$fname || return 1 From 22a9a7c3843c53b066a884eff3732194edd3bef9 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 10:26:08 -0700 Subject: [PATCH 2/8] Remove linuxmint derivative mappings for EOL ubuntu OSes --- bootstrap-salt.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 23b87df..46b0a76 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1201,12 +1201,6 @@ __ubuntu_derivatives_translation() { # Mappings trisquel_6_ubuntu_base="12.04" linuxmint_13_ubuntu_base="12.04" - linuxmint_14_ubuntu_base="12.10" - #linuxmint_15_ubuntu_base="13.04" - # Bug preventing add-apt-repository from working on Mint 15: - # https://bugs.launchpad.net/linuxmint/+bug/1198751 - - linuxmint_16_ubuntu_base="13.10" linuxmint_17_ubuntu_base="14.04" linuxmint_18_ubuntu_base="16.04" linaro_12_ubuntu_base="12.04" From c80e8e6caebc7448c5117c058b9975d75521291c Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 21 Dec 2016 11:19:18 -0700 Subject: [PATCH 3/8] Remove Ubuntu 15 from ubuntu_codename_translation function --- bootstrap-salt.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 46b0a76..65f69ac 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1258,13 +1258,6 @@ __ubuntu_codename_translation() { "14") DISTRO_CODENAME="trusty" ;; - "15") - if [ -n "$_april" ]; then - DISTRO_CODENAME="vivid" - else - DISTRO_CODENAME="wily" - fi - ;; "16") DISTRO_CODENAME="xenial" ;; From 2e49173293e5e73dfc6f68b7f749a0ea1a4a89c9 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 22 Dec 2016 10:13:01 -0700 Subject: [PATCH 4/8] Various fixes from PR review: - Update Linux Mint supported versions in README file - Remove if statement restricting archive.ubuntu.com repository addition - Remove old-releases.ubuntu.com repository addition - Remove some unnecessary parens in an if statement && clause - Add the python-software-properties install logic back in for Ubutu 12 - Remove the workaround for starting deamons for older versions (no longer applicable) - Fix architecture spelling in README file --- README.rst | 6 +++--- bootstrap-salt.sh | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/README.rst b/README.rst index c31058e..93e2f3b 100644 --- a/README.rst +++ b/README.rst @@ -216,8 +216,8 @@ Debian and derivatives .. note:: Installation of Salt packages on Debian 8 based distribution from repo.saltstack.com repository - is currently supported for ``amd64`` (``x86-64``) and ``armhf`` architechtures ONLY. Use ``git`` - bootstrap mode as described above to install Salt on other architechtures, such as ``i386`` or + is currently supported for ``amd64`` (``x86-64``) and ``armhf`` architectures ONLY. Use ``git`` + bootstrap mode as described above to install Salt on other architectures, such as ``i386`` or ``armel``. You also may need to disable repository configuration and allow ``pip`` installations by providing ``-r`` and ``-P`` options to the bootstrap script, i.e.: @@ -251,7 +251,7 @@ Ubuntu and derivatives - Elementary OS 0.2 (based on Ubuntu 12.04) - Linaro 12.04 -- Linux Mint 13/14/16/17/18 +- Linux Mint 13/17/18 - Trisquel GNU/Linux 6 (based on Ubuntu 12.04) - Ubuntu 12.04/14.04/16.04 diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 65f69ac..ea2cd48 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2294,12 +2294,7 @@ __enable_universe_repository() { echodebug "Enabling the universe repository" - # Ubuntu versions higher than 12.04 do not live in the old repositories - if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then - add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 - fi - - add-apt-repository -y "deb http://old-releases.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 + add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" || return 1 return 0 } @@ -2364,7 +2359,7 @@ install_ubuntu_deps() { } install_ubuntu_stable_deps() { - if ([ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]); then + if [ "${_SLEEP}" -eq "${__DEFAULT_SLEEP}" ] && [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then # The user did not pass a custom sleep value as an argument, let's increase the default value echodebug "On Ubuntu systems we increase the default sleep value to 10." echodebug "See https://github.com/saltstack/salt/issues/12248 for more info." @@ -2450,7 +2445,12 @@ install_ubuntu_stable_deps() { install_ubuntu_daily_deps() { install_ubuntu_stable_deps || return 1 - __apt_get_install_noinput software-properties-common || return 1 + if [ "$DISTRO_MAJOR_VERSION" -gt 12 ]; then + __apt_get_install_noinput software-properties-common || return 1 + else + # Ubuntu 12.04 needs python-software-properties to get add-apt-repository binary + __apt_get_install_noinput python-software-properties || return 1 + fi if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then __enable_universe_repository || return 1 @@ -2559,12 +2559,6 @@ install_ubuntu_git() { } install_ubuntu_stable_post() { - # Workaround for latest LTS packages on latest ubuntu. Normally packages on - # debian-based systems will automatically start the corresponding daemons - if [ "$DISTRO_MAJOR_VERSION" -lt 16 ]; then - return 0 - fi - for fname in api master minion syndic; do # Skip salt-api since the service should be opt-in and not necessarily started on boot [ $fname = "api" ] && continue From 20d88f2f1fca57c7f0a7e210a07c6ac493eca994 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 4 Jan 2017 09:32:34 -0500 Subject: [PATCH 5/8] Simplify ubuntu version check to look for "16.10" --- bootstrap-salt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index ea2cd48..61ee98e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2404,7 +2404,7 @@ install_ubuntu_stable_deps() { # Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com if [ "$(echo "$STABLE_REV" | egrep '^(2015\.5|2015\.8|2016\.3|2016\.11|latest|archive\/)')" != "" ]; then # Workaround for latest non-LTS ubuntu - if [ "$DISTRO_MAJOR_VERSION" -eq 16 ] && [ "$DISTRO_MINOR_VERSION" -eq 10 ]; then + if [ "$DISTRO_VERSION" = "16.10" ]; then echowarn "Non-LTS Ubuntu detected, but stable packages requested. Trying packages from latest LTS release. You may experience problems." UBUNTU_VERSION=16.04 UBUNTU_CODENAME=xenial From cb87b7d0bd95b0a73825962c0f6b24670c245b80 Mon Sep 17 00:00:00 2001 From: rallytime Date: Wed, 4 Jan 2017 11:08:04 -0500 Subject: [PATCH 6/8] Add note about best-effort support for non-lts ubuntu releases to README --- README.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.rst b/README.rst index 93e2f3b..9313f4e 100644 --- a/README.rst +++ b/README.rst @@ -255,6 +255,20 @@ Ubuntu and derivatives - Trisquel GNU/Linux 6 (based on Ubuntu 12.04) - Ubuntu 12.04/14.04/16.04 +Ubuntu Best Effort Support: Non-LTS releases + +This script provides best-effort support for current, non-LTS +Ubuntu releases. If package repositories are not provided on +[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) for +the non-LTS release, the bootstrap script will attempt to +install the packages for the most closely related LTS Ubuntu +release instead. + +For example, when installing Salt on Ubuntu 16.10, the bootstrap +script will setup the repository for Ubuntu 16.04 from +[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) and +install the 16.04 packages. + Other Linux distro ~~~~~~~~~~~~~~~~~~ From 436144ce46dca22bddd42cbcf7682f5a432e7289 Mon Sep 17 00:00:00 2001 From: rallytime Date: Thu, 5 Jan 2017 09:49:11 -0500 Subject: [PATCH 7/8] Use rst syntax and not markdown in README file --- README.rst | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index 9313f4e..1e35657 100644 --- a/README.rst +++ b/README.rst @@ -257,17 +257,15 @@ Ubuntu and derivatives Ubuntu Best Effort Support: Non-LTS releases -This script provides best-effort support for current, non-LTS -Ubuntu releases. If package repositories are not provided on -[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) for -the non-LTS release, the bootstrap script will attempt to -install the packages for the most closely related LTS Ubuntu -release instead. +This script provides best-effort support for current, non-LTS Ubuntu releases. If package +repositories are not provided on `SaltStack's Ubuntu repository`_ for the non-LTS release, the +bootstrap script will attempt to install the packages for the most closely related LTS Ubuntu +release instead. -For example, when installing Salt on Ubuntu 16.10, the bootstrap -script will setup the repository for Ubuntu 16.04 from -[repo.saltstack.com](http://repo.saltstack.com/#ubuntu) and -install the 16.04 packages. +For example, when installing Salt on Ubuntu 16.10, the bootstrap script will setup the repository +for Ubuntu 16.04 from `SaltStack's Ubuntu repository`_ and install the 16.04 packages. + +.. _`SaltStack's Ubuntu repository`: http://repo.saltstack.com/#ubuntu Other Linux distro From e16f24329c3262b1a2d50a864c047f442b341169 Mon Sep 17 00:00:00 2001 From: rallytime Date: Fri, 6 Jan 2017 09:48:25 -0500 Subject: [PATCH 8/8] Make sub-section for non-lts ubuntu releases note --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1e35657..ce9779e 100644 --- a/README.rst +++ b/README.rst @@ -255,7 +255,8 @@ Ubuntu and derivatives - Trisquel GNU/Linux 6 (based on Ubuntu 12.04) - Ubuntu 12.04/14.04/16.04 -Ubuntu Best Effort Support: Non-LTS releases +Ubuntu Best Effort Support: Non-LTS Releases +******************************************** This script provides best-effort support for current, non-LTS Ubuntu releases. If package repositories are not provided on `SaltStack's Ubuntu repository`_ for the non-LTS release, the