summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2017-09-12 15:57:31 -0600
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-09-15 16:02:09 +0000
commit3f04e1fd72b14420788af64b14c35a5f74727f82 (patch)
treec24bcdc17fe9a098c6a1e5b010dd1697c4f50f11
parentd36ba74332cd5e7aeac0b061a5903bcc63a18a20 (diff)
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 <mchandras@suse.de>
-rwxr-xr-xbifrost/scripts/bifrost-provision.sh17
1 files changed, 16 insertions, 1 deletions
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