1818# ======================================================================================================================
1919set -o nounset # Treat unset variables as an error
2020
21- __ScriptVersion=" 2016.08.15 "
21+ __ScriptVersion=" 2016.08.16 "
2222__ScriptName=" bootstrap-salt.sh"
2323
2424__ScriptFullName=" $0 "
@@ -2270,23 +2270,8 @@ __enable_universe_repository() {
22702270}
22712271
22722272install_ubuntu_deps () {
2273- if ([ " ${_SLEEP} " -eq " ${__DEFAULT_SLEEP} " ] && [ " $DISTRO_MAJOR_VERSION " -lt 15 ]); then
2274- # The user did not pass a custom sleep value as an argument, let's increase the default value
2275- echodebug " On Ubuntu systems we increase the default sleep value to 10."
2276- echodebug " See https://github.com/saltstack/salt/issues/12248 for more info."
2277- _SLEEP=10
2278- fi
2279- if [ $_START_DAEMONS -eq $BS_FALSE ]; then
2280- echowarn " Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour."
2281- fi
2282- # No user interaction, libc6 restart services for example
2283- export DEBIAN_FRONTEND=noninteractive
2284-
22852273 apt-get update
22862274
2287- # Install Keys
2288- __apt_get_install_noinput debian-archive-keyring && apt-get update
2289-
22902275 if [ " $DISTRO_MAJOR_VERSION " -gt 12 ] || ([ " $DISTRO_MAJOR_VERSION " -eq 12 ] && [ " $DISTRO_MINOR_VERSION " -eq 10 ]); then
22912276 # Above Ubuntu 12.04 add-apt-repository is in a different package
22922277 __apt_get_install_noinput software-properties-common || return 1
@@ -2317,9 +2302,9 @@ install_ubuntu_deps() {
23172302 fi
23182303
23192304 fi
2320- fi
23212305
2322- __PIP_PACKAGES=" "
2306+ apt-get update
2307+ fi
23232308
23242309 # Minimal systems might not have upstart installed, install it
23252310 __PACKAGES=" upstart"
@@ -2339,22 +2324,13 @@ install_ubuntu_deps() {
23392324 # Additionally install procps and pciutils which allows for Docker bootstraps. See 366#issuecomment-39666813
23402325 __PACKAGES=" ${__PACKAGES} procps pciutils"
23412326
2342- apt-get update
2343- # shellcheck disable=SC2086,SC2090
2344- __apt_get_install_noinput ${__PACKAGES} || return 1
2345-
2346- if [ " ${__PIP_PACKAGES} " != " " ]; then
2347- # shellcheck disable=SC2086,SC2090
2348- if [ " $_VIRTUALENV_DIR " != " null" ]; then
2349- __activate_virtualenv
2350- fi
2351- pip install -U " ${__PIP_PACKAGES} "
2352- fi
2353-
23542327 if [ " $_UPGRADE_SYS " -eq $BS_TRUE ]; then
23552328 __apt_get_upgrade_noinput || return 1
23562329 fi
23572330
2331+ # shellcheck disable=SC2086,SC2090
2332+ __apt_get_install_noinput ${__PACKAGES} || return 1
2333+
23582334 if [ " ${_EXTRA_PACKAGES} " != " " ]; then
23592335 echoinfo " Installing the following extra packages as requested: ${_EXTRA_PACKAGES} "
23602336 # shellcheck disable=SC2086
@@ -2365,7 +2341,24 @@ install_ubuntu_deps() {
23652341}
23662342
23672343install_ubuntu_stable_deps () {
2368- install_ubuntu_deps || return 1
2344+ if ([ " ${_SLEEP} " -eq " ${__DEFAULT_SLEEP} " ] && [ " $DISTRO_MAJOR_VERSION " -lt 15 ]); then
2345+ # The user did not pass a custom sleep value as an argument, let's increase the default value
2346+ echodebug " On Ubuntu systems we increase the default sleep value to 10."
2347+ echodebug " See https://github.com/saltstack/salt/issues/12248 for more info."
2348+ _SLEEP=10
2349+ fi
2350+
2351+ if [ $_START_DAEMONS -eq $BS_FALSE ]; then
2352+ echowarn " Not starting daemons on Debian based distributions is not working mostly because starting them is the default behaviour."
2353+ fi
2354+
2355+ # No user interaction, libc6 restart services for example
2356+ export DEBIAN_FRONTEND=noninteractive
2357+
2358+ apt-get update
2359+
2360+ # Install Keys
2361+ __apt_get_install_noinput debian-archive-keyring && apt-get update
23692362
23702363 if [ $_DISABLE_REPOS -eq $BS_FALSE ]; then
23712364 __get_dpkg_architecture || return 1
@@ -2385,7 +2378,7 @@ install_ubuntu_stable_deps() {
23852378 fi
23862379 fi
23872380
2388- # Versions starting with 2015.5.6 and 2015.8.1 are hosted at repo.saltstack.com
2381+ # Versions starting with 2015.5.6, 2015.8.1 and 2016.3.0 are hosted at repo.saltstack.com
23892382 if [ " $( echo " $STABLE_REV " | egrep ' ^(2015\.5|2015\.8|2016\.3|latest|archive\/)' ) " != " " ]; then
23902383 # Workaround for latest non-LTS ubuntu
23912384 if [ " $DISTRO_MAJOR_VERSION " -eq 15 ]; then
@@ -2400,11 +2393,7 @@ install_ubuntu_stable_deps() {
24002393 # SaltStack's stable Ubuntu repository:
24012394 SALTSTACK_UBUNTU_URL=" ${HTTP_VAL} ://repo.saltstack.com/apt/ubuntu/${UBUNTU_VERSION} /${__REPO_ARCH} /${STABLE_REV} "
24022395
2403- if [ " $( grep -ER ' latest .+ main' /etc/apt) " = " " ]; then
2404- set +o nounset
2405- echo " deb $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > " /etc/apt/sources.list.d/saltstack.list"
2406- set -o nounset
2407- fi
2396+ apt-get update
24082397
24092398 # Make sure https transport is available
24102399 if [ " $HTTP_VAL " = " https" ] ; then
@@ -2414,6 +2403,12 @@ install_ubuntu_stable_deps() {
24142403 # Make sure wget is available
24152404 __apt_get_install_noinput wget
24162405
2406+ if [ " $( grep -ER ' latest .+ main' /etc/apt) " = " " ]; then
2407+ set +o nounset
2408+ echo " deb $SALTSTACK_UBUNTU_URL $UBUNTU_CODENAME main" > " /etc/apt/sources.list.d/saltstack.list"
2409+ set -o nounset
2410+ fi
2411+
24172412 # shellcheck disable=SC2086
24182413 wget $_WGET_ARGS -q $SALTSTACK_UBUNTU_URL /SALTSTACK-GPG-KEY.pub -O - | apt-key add - || return 1
24192414
@@ -2436,11 +2431,11 @@ install_ubuntu_stable_deps() {
24362431 fi
24372432 fi
24382433
2439- apt-get update
2434+ install_ubuntu_deps || return 1
24402435}
24412436
24422437install_ubuntu_daily_deps () {
2443- install_ubuntu_deps || return 1
2438+ install_ubuntu_stable_deps || return 1
24442439
24452440 if [ " $DISTRO_MAJOR_VERSION " -ge 12 ]; then
24462441 # Above Ubuntu 11.10 add-apt-repository is in a different package
@@ -2476,10 +2471,9 @@ install_ubuntu_git_deps() {
24762471 __git_clone_and_checkout || return 1
24772472
24782473 __PACKAGES=" "
2479- __PIP_PACKAGES=" "
24802474
24812475 # See how we are installing packages
2482- if [ ${_PIP_ALL} -eq $BS_TRUE ]; then
2476+ if [ " ${_PIP_ALL} " -eq $BS_TRUE ]; then
24832477 __PACKAGES=" ${__PACKAGES} python-dev swig libssl-dev libzmq3 libzmq3-dev"
24842478
24852479 if ! __check_command_exists pip; then
@@ -2492,37 +2486,18 @@ install_ubuntu_git_deps() {
24922486 # Install the pythons from requirements (only zmq for now)
24932487 __install_pip_deps " ${_SALT_GIT_CHECKOUT_DIR} /requirements/zeromq.txt" || return 1
24942488 else
2495- install_ubuntu_deps || return 1
2496- __PACKAGES=" ${__PACKAGES} python-yaml python-m2crypto python-crypto msgpack-python python-zmq python-jinja2"
2489+ install_ubuntu_stable_deps || return 1
2490+
2491+ __PACKAGES=" ${__PACKAGES} python-crypto python-jinja2 python-m2crypto python-msgpack python-requests"
2492+ __PACKAGES=" ${__PACKAGES} python-tornado python-yaml python-zmq"
24972493
24982494 if [ " $_INSTALL_CLOUD " -eq $BS_TRUE ]; then
24992495 # Install python-libcloud if asked to
25002496 __PACKAGES=" ${__PACKAGES} python-libcloud"
25012497 fi
25022498
2503- if [ -f " ${_SALT_GIT_CHECKOUT_DIR} /requirements/base.txt" ]; then
2504- # We're on the develop branch, install whichever tornado is on the requirements file
2505- __REQUIRED_TORNADO=" $( grep tornado " ${_SALT_GIT_CHECKOUT_DIR} /requirements/base.txt" ) "
2506-
2507- if [ " ${__REQUIRED_TORNADO} " != " " ]; then
2508- __check_pip_allowed " You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO} '"
2509-
2510- __PACKAGES=" ${__PACKAGES} python-dev"
2511- __PIP_PACKAGES=" ${__PIP_PACKAGES} ${__REQUIRED_TORNADO} "
2512-
2513- if ! __check_command_exists pip; then
2514- __PACKAGES=" ${__PACKAGES} python-setuptools python-pip"
2515- fi
2516- fi
2517- fi
2518-
25192499 # shellcheck disable=SC2086
25202500 __apt_get_install_noinput ${__PACKAGES} || return 1
2521-
2522- if [ " ${__PIP_PACKAGES} " != " " ]; then
2523- # shellcheck disable=SC2086,SC2090
2524- pip install -U ${__PIP_PACKAGES} || return 1
2525- fi
25262501 fi
25272502
25282503 # Let's trigger config_salt()
@@ -2578,7 +2553,7 @@ install_ubuntu_stable_post() {
25782553 # Workaround for latest LTS packages on latest ubuntu. Normally packages on
25792554 # debian-based systems will automatically start the corresponding daemons
25802555 if [ " $DISTRO_MAJOR_VERSION " -lt 15 ]; then
2581- return 0
2556+ return 0
25822557 fi
25832558
25842559 for fname in minion master syndic api; do
0 commit comments