Commit cce020ca by Edward Zarecor Committed by Kevin Falcone

Update ansible-bootstrap to work on 16.04

Update common to pull down the non-ppa python on 16.04
parent da450eea
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
ansible_distribution_release in common_custom_ppa_releases ansible_distribution_release in common_custom_ppa_releases
- name: Add custom edX PPA - name: Add custom edX PPA
# Ensure that we get a current version of Git and latest version of python 2.7
# GitHub requires version 1.7.10 or later
# https://help.github.com/articles/https-cloning-errors
apt_repository: apt_repository:
repo: "{{ COMMON_EDX_PPA }}" repo: "{{ COMMON_EDX_PPA }}"
when: > when: >
......
...@@ -44,7 +44,7 @@ PYTHON_BIN="${VIRTUAL_ENV}/bin" ...@@ -44,7 +44,7 @@ PYTHON_BIN="${VIRTUAL_ENV}/bin"
ANSIBLE_DIR="/tmp/ansible" ANSIBLE_DIR="/tmp/ansible"
CONFIGURATION_DIR="/tmp/configuration" CONFIGURATION_DIR="/tmp/configuration"
EDX_PPA="deb http://ppa.edx.org precise main" EDX_PPA="deb http://ppa.edx.org precise main"
EDX_PPA_KEY_SERVER="pgp.mit.edu" EDX_PPA_KEY_SERVER="hkp://pgp.mit.edu:80"
EDX_PPA_KEY_ID="69464050" EDX_PPA_KEY_ID="69464050"
cat << EOF cat << EOF
...@@ -72,10 +72,13 @@ then ...@@ -72,10 +72,13 @@ then
elif grep -q 'Trusty Tahr' /etc/os-release elif grep -q 'Trusty Tahr' /etc/os-release
then then
SHORT_DIST="trusty" SHORT_DIST="trusty"
elif grep -q 'Xenial Xerus' /etc/os-release
then
SHORT_DIST="xenial"
else else
cat << EOF cat << EOF
This script is only known to work on Ubuntu Precise and Trusty, This script is only known to work on Ubuntu Precise, Trusty and Xenial,
exiting. If you are interested in helping make installation possible exiting. If you are interested in helping make installation possible
on other platforms, let us know. on other platforms, let us know.
...@@ -93,24 +96,39 @@ if [ "${UPGRADE_OS}" = true ]; then ...@@ -93,24 +96,39 @@ if [ "${UPGRADE_OS}" = true ]; then
echo "Upgrading the OS..." echo "Upgrading the OS..."
apt-get upgrade -y apt-get upgrade -y
fi fi
# Required for add-apt-repository # Required for add-apt-repository
apt-get install -y software-properties-common python-software-properties apt-get install -y software-properties-common python-software-properties
# Add git PPA # Add git PPA
add-apt-repository -y ppa:git-core/ppa add-apt-repository -y ppa:git-core/ppa
# Add python PPA # For older distributions we need to install a PPA for Python 2.7.10
apt-key adv --keyserver "${EDX_PPA_KEY_SERVER}" --recv-keys "${EDX_PPA_KEY_ID}" if [[ "precise" = "${SHORT_DIST}" || "trusty" = "${SHORT_DIST}" ]]; then
add-apt-repository -y "${EDX_PPA}"
# Add python PPA
apt-key adv --keyserver "${EDX_PPA_KEY_SERVER}" --recv-keys "${EDX_PPA_KEY_ID}"
add-apt-repository -y "${EDX_PPA}"
fi
# Install python 2.7 latest, git and other common requirements # Install python 2.7 latest, git and other common requirements
# NOTE: This will install the latest version of python 2.7 and # NOTE: This will install the latest version of python 2.7 and
# which may differ from what is pinned in virtualenvironments # which may differ from what is pinned in virtualenvironments
apt-get update -y apt-get update -y
apt-get install -y build-essential sudo git-core python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2 libmysqlclient-dev
pip install --upgrade pip=="${PIP_VERSION}" apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2 build-essential sudo git-core libmysqlclient-dev
# Workaround for a 16.04 bug, need to upgrade to latest and then
# potentially downgrade to the preferred version.
if [[ "xenial" = "${SHORT_DIST}" ]]; then
#apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2
pip install --upgrade pip
pip install --upgrade pip=="${PIP_VERSION}"
#apt-get install -y build-essential sudo git-core libmysqlclient-dev
else
#apt-get install -y python2.7 python2.7-dev python-pip python-apt python-yaml python-jinja2 build-essential sudo git-core libmysqlclient-dev
pip install --upgrade pip=="${PIP_VERSION}"
fi
# pip moves to /usr/local/bin when upgraded # pip moves to /usr/local/bin when upgraded
PATH=/usr/local/bin:${PATH} PATH=/usr/local/bin:${PATH}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment