Fix check for install venv and ansible pip

This commit is contained in:
Victor LABORIE 2018-09-05 15:24:19 +02:00
parent b9227f3354
commit 456208856d
1 changed files with 5 additions and 4 deletions

View File

@ -6,7 +6,8 @@ ANSIBLE_VERSION="${ANSIBLE_VERSION:-stable-2.2}"
DEBIAN_FRONTEND=noninteractive apt-get -yq install build-essential python-dev python-virtualenv git
if [ ! -d venv ]; then
virtualenv /tmp/venv
. /tmp/venv/bin/activate && pip install "git+https://github.com/ansible/ansible.git@${ANSIBLE_VERSION}"; deactivate
fi
[ ! -f "/tmp/venv/bin/activate" ] && virtualenv /tmp/venv
[ ! -x "/tmp/venv/bin/ansible" ] && . /tmp/venv/bin/activate && pip install "git+https://github.com/ansible/ansible.git@${ANSIBLE_VERSION}"
exit 0