|
17 | 17 | # CREATED: 10/15/2012 09:49:37 PM WEST |
18 | 18 | #====================================================================================================================== |
19 | 19 | set -o nounset # Treat unset variables as an error |
20 | | -__ScriptVersion="2015.07.17" |
| 20 | +__ScriptVersion="2015.07.22" |
21 | 21 | __ScriptName="bootstrap-salt.sh" |
22 | 22 |
|
23 | 23 | #====================================================================================================================== |
@@ -426,8 +426,8 @@ elif [ "$ITYPE" = "stable" ]; then |
426 | 426 | STABLE_REV="latest" |
427 | 427 | else |
428 | 428 | __check_unparsed_options "$*" |
429 | | - if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5)$')" = "" ]; then |
430 | | - echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, latest)" |
| 429 | + if [ "$(echo "$1" | egrep '^(latest|1\.6|1\.7|2014\.1|2014\.7|2015\.5|2015\.8)$')" = "" ]; then |
| 430 | + echo "Unknown stable version: $1 (valid: 1.6, 1.7, 2014.1, 2014.7, 2015.5, 2015.8, latest)" |
431 | 431 | exit 1 |
432 | 432 | else |
433 | 433 | STABLE_REV="$1" |
@@ -1758,39 +1758,50 @@ install_ubuntu_deps() { |
1758 | 1758 |
|
1759 | 1759 | __enable_universe_repository || return 1 |
1760 | 1760 |
|
| 1761 | + __PIP_PACKAGES="" |
| 1762 | + |
1761 | 1763 | # Minimal systems might not have upstart installed, install it |
1762 | | - __apt_get_install_noinput upstart |
| 1764 | + __PACKAGES="upstart" |
1763 | 1765 |
|
1764 | 1766 | # Need python-apt for managing packages via Salt |
1765 | | - __apt_get_install_noinput python-apt |
| 1767 | + __PACKAGES="${__PACKAGES} python-apt" |
| 1768 | + |
| 1769 | + echoinfo "Installing Python Requests/Chardet from Chris Lea's PPA repository" |
| 1770 | + if [ "$DISTRO_MAJOR_VERSION" -gt 11 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 11 ] && [ "$DISTRO_MINOR_VERSION" -gt 04 ]); then |
| 1771 | + # Above Ubuntu 11.04 add a -y flag |
| 1772 | + add-apt-repository -y "ppa:chris-lea/python-requests" || return 1 |
| 1773 | + add-apt-repository -y "ppa:chris-lea/python-chardet" || return 1 |
| 1774 | + else |
| 1775 | + add-apt-repository "ppa:chris-lea/python-requests" || return 1 |
| 1776 | + add-apt-repository "ppa:chris-lea/python-chardet" || return 1 |
| 1777 | + fi |
| 1778 | + |
| 1779 | + __PACKAGES="${__PACKAGES} python-requests" |
1766 | 1780 |
|
1767 | 1781 | if [ "$DISTRO_MAJOR_VERSION" -gt 12 ] || ([ "$DISTRO_MAJOR_VERSION" -eq 12 ] && [ "$DISTRO_MINOR_VERSION" -gt 03 ]); then |
1768 | 1782 | if ([ "$DISTRO_MAJOR_VERSION" -lt 15 ] && [ "$_ENABLE_EXTERNAL_ZMQ_REPOS" -eq $BS_TRUE ]); then |
1769 | 1783 | echoinfo "Installing ZMQ>=4/PyZMQ>=14 from Chris Lea's PPA repository" |
1770 | 1784 | add-apt-repository -y ppa:chris-lea/zeromq || return 1 |
1771 | | - apt-get update |
1772 | 1785 | fi |
1773 | | - __apt_get_install_noinput python-requests |
1774 | | - __PIP_PACKAGES="" |
1775 | | - else |
1776 | | - check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package 'requests'" |
1777 | | - __apt_get_install_noinput python-setuptools python-pip |
1778 | | - # shellcheck disable=SC2089 |
1779 | | - __PIP_PACKAGES="requests>=$_PY_REQUESTS_MIN_VERSION" |
1780 | 1786 | fi |
1781 | 1787 |
|
1782 | 1788 | # Additionally install procps and pciutils which allows for Docker boostraps. See 366#issuecomment-39666813 |
1783 | | - __apt_get_install_noinput procps pciutils || return 1 |
| 1789 | + __PACKAGES="${__PACKAGES} procps pciutils" |
| 1790 | + |
1784 | 1791 |
|
1785 | 1792 | if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then |
1786 | 1793 | check_pip_allowed "You need to allow pip based installations (-P) in order to install 'apache-libcloud'" |
1787 | | - if [ "${__PIP_PACKAGES}" = "" ]; then |
1788 | | - __apt_get_install_noinput python-pip |
| 1794 | + if [ "$(which pip)" = "" ]; then |
| 1795 | + __PACKAGES="${__PACKAGES} python-setuptools python-pip" |
1789 | 1796 | fi |
1790 | 1797 | # shellcheck disable=SC2089 |
1791 | 1798 | __PIP_PACKAGES="${__PIP_PACKAGES} 'apache-libcloud>=$_LIBCLOUD_MIN_VERSION'" |
1792 | 1799 | fi |
1793 | 1800 |
|
| 1801 | + apt-get update |
| 1802 | + # shellcheck disable=SC2086,SC2090 |
| 1803 | + __apt_get_install_noinput ${__PACKAGES} || return 1 |
| 1804 | + |
1794 | 1805 | if [ "${__PIP_PACKAGES}" != "" ]; then |
1795 | 1806 | # shellcheck disable=SC2086,SC2090 |
1796 | 1807 | pip install -U ${__PIP_PACKAGES} |
@@ -1828,6 +1839,16 @@ install_ubuntu_stable_deps() { |
1828 | 1839 | add-apt-repository "ppa:$STABLE_PPA" || return 1 |
1829 | 1840 | fi |
1830 | 1841 |
|
| 1842 | + if [ ! "$(echo "$STABLE_REV" | egrep '^(2015\.8|latest)$')" = "" ]; then |
| 1843 | + # We need a recent tornado package |
| 1844 | + __REQUIRED_TORNADO="tornado >= 4.0" |
| 1845 | + check_pip_allowed "You need to allow pip based installations (-P) in order to install the python package '${__REQUIRED_TORNADO}'" |
| 1846 | + if [ "$(which pip)" = "" ]; then |
| 1847 | + __apt_get_install_noinput python-setuptools python-pip |
| 1848 | + fi |
| 1849 | + pip install -U "${__REQUIRED_TORNADO}" |
| 1850 | + fi |
| 1851 | + |
1831 | 1852 | apt-get update |
1832 | 1853 | } |
1833 | 1854 |
|
@@ -1874,7 +1895,7 @@ install_ubuntu_git_deps() { |
1874 | 1895 | if [ "$(which pip)" = "" ]; then |
1875 | 1896 | __apt_get_install_noinput python-setuptools python-pip |
1876 | 1897 | fi |
1877 | | - pip install -U "'${__REQUIRED_TORNADO}'" |
| 1898 | + pip install -U "${__REQUIRED_TORNADO}" |
1878 | 1899 | fi |
1879 | 1900 | fi |
1880 | 1901 |
|
@@ -4226,7 +4247,7 @@ install_smartos_git_deps() { |
4226 | 4247 | if [ "$(which pip)" = "" ]; then |
4227 | 4248 | pkgin -y install py27-pip |
4228 | 4249 | fi |
4229 | | - pip install -U "'${__REQUIRED_TORNADO}'" |
| 4250 | + pip install -U "${__REQUIRED_TORNADO}" |
4230 | 4251 | fi |
4231 | 4252 | fi |
4232 | 4253 |
|
|
0 commit comments