packer/scripts/ansible_install_pip

14 lines
378 B
Bash
Executable File

#!/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
[ ! -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