packer/scripts/ansible_install_pip

13 lines
342 B
Plaintext
Raw Normal View History

2018-09-03 16:39:18 +02:00
#!/bin/sh
set -eu
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