bifrost/scripts/install-ansible-pip.sh
Pavlo Shchelokovskyy eb727f4a01 Allow installing Ansible from PyPI
As of Ansible v2.2 all the missing modules bifrost requires are included
in the pip-installable Ansible package.
Let's allow then for a possiibility for bifrost to install Ansible
directly from PyPI (into the system or in virtualenv) instead
of from cloned source repo.

This patsh first extracts the installation of binary/Python dependencies
and installation of Ansible itself from the "env-setup.sh" script to two
separate scripts "install-deps.sh" and "install-ansible-source.sh".

It also adds a third script "install-ansible-pip.sh" that is called when
environment variable ANSIBLE_FROM_PYPI is set to "True"
(default is "False" for backward compatibility).
It then looks up ANSIBLE_PIP_VERSION env variable (defaults to "2.2")
and pip-installs Ansible of that given version strictly.

Change-Id: Ia72e06d7bf127569d423fa521b8ddab87453809e
2016-12-05 15:17:06 +00:00

16 lines
296 B
Bash

#!/bin/bash
set -eu
ANSIBLE_PIP_VERSION=${ANSIBLE_PIP_VERSION:-"2.2"}
sudo -H -E ${PIP} install "ansible==$ANSIBLE_PIP_VERSION"
echo
echo "To use bifrost, do"
if [ -n "${VENV-}" ]; then
echo "source ${VENV}/bin/activate"
fi
echo "source env-vars"
echo "Then run playbooks as normal."
echo