From 3f04e1fd72b14420788af64b14c35a5f74727f82 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 12 Sep 2017 15:57:31 -0600 Subject: bifrost: Use virtual environment for bifrost bifrost forces us to use an old Ansible version which means we can't take advantage of new features in XCI playbooks. As such, we move the entire bifrost step to a virtual environment so we can have a newer version of Ansible on the host. Change-Id: I94874d600a29247b7826324cc111901995df90dc Signed-off-by: Markos Chandras --- bifrost/scripts/bifrost-provision.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bifrost/scripts/bifrost-provision.sh b/bifrost/scripts/bifrost-provision.sh index ad028070..0cca82da 100755 --- a/bifrost/scripts/bifrost-provision.sh +++ b/bifrost/scripts/bifrost-provision.sh @@ -17,7 +17,7 @@ ANSIBLE_INSTALL_ROOT=${ANSIBLE_INSTALL_ROOT:-/opt/stack} ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY-"-vvvv"} ENABLE_VENV="false" USE_DHCP="false" -USE_VENV="false" +USE_VENV="true" BUILD_IMAGE=true PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} @@ -67,6 +67,21 @@ export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,language-p # Additional dib elements export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"} +if [ ${USE_VENV} = "true" ]; then + export VENV=/opt/stack/bifrost + $SCRIPT_HOME/env-setup.sh + # Note(cinerama): activate is not compatible with "set -u"; + # disable it just for this line. + set +u + source ${VENV}/bin/activate + set -u + ANSIBLE=${VENV}/bin/ansible-playbook + ENABLE_VENV="true" +else + $SCRIPT_HOME/env-setup.sh + ANSIBLE=${HOME}/.local/bin/ansible-playbook +fi + # Source Ansible set +x +o nounset $SCRIPT_HOME/env-setup.sh -- cgit 1.2.3-korg