From eead93830fc0d20996287439d765770d69bc533c Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 18 Sep 2017 20:16:43 +0100 Subject: [PATCH] xci: Move VM provisioning to xci-deploy.sh The bifrost-provision.sh script will provision machines using Ansible playbooks. If we run this script in an Ansible playbook, that means that we will run Ansible with Ansible and this can only lead to further confusion when debugging issues. As such, since we already have a script to provision machines, lets use it directly from the xci-deploy.sh script. This also reverts 3f04e1fd72b14420788af64b14c35a5f74727f82 which added virtualenv support in bifrost since that causes more problems than it fixes for the time being. Change-Id: Id82b7c06a2af28b66f64f1966227888227ec276f Signed-off-by: Markos Chandras --- bifrost/scripts/bifrost-provision.sh | 2 +- xci/playbooks/provision-vm-nodes.yml | 11 ----------- xci/xci-deploy.sh | 9 +++++++++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bifrost/scripts/bifrost-provision.sh b/bifrost/scripts/bifrost-provision.sh index df05c7ce..d4d1f96a 100755 --- a/bifrost/scripts/bifrost-provision.sh +++ b/bifrost/scripts/bifrost-provision.sh @@ -16,7 +16,7 @@ BIFROST_HOME=$SCRIPT_HOME/.. ANSIBLE_INSTALL_ROOT=${ANSIBLE_INSTALL_ROOT:-/opt/stack} ENABLE_VENV="false" USE_DHCP="false" -USE_VENV="true" +USE_VENV="false" BUILD_IMAGE=true PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} diff --git a/xci/playbooks/provision-vm-nodes.yml b/xci/playbooks/provision-vm-nodes.yml index 0419dcfc..3d88c5cb 100644 --- a/xci/playbooks/provision-vm-nodes.yml +++ b/xci/playbooks/provision-vm-nodes.yml @@ -90,14 +90,3 @@ command: "/bin/bash ./scripts/destroy-env.sh" args: chdir: "{{ OPENSTACK_BIFROST_PATH }}" - -- hosts: localhost - connection: local - vars_files: - - ../var/{{ ansible_os_family }}.yml - - ../var/opnfv.yml - tasks: - - name: create and provision VM nodes for the flavor {{ XCI_FLAVOR }} - command: "/bin/bash ./scripts/bifrost-provision.sh" - args: - chdir: "{{ OPENSTACK_BIFROST_PATH }}" diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index 6a661349..19f2c18a 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -115,7 +115,13 @@ fi echo "Info: Starting provisining VM nodes using openstack/bifrost" echo "-------------------------------------------------------------------------" cd $XCI_PATH/playbooks +# NOTE(hwoarang) we need newer ansible to work on the following playbook +sudo pip uninstall -y ansible || true +sudo -H pip uninstall -y ansible || true +sudo pip install ansible==${XCI_ANSIBLE_PIP_VERSION} ansible-playbook -i inventory provision-vm-nodes.yml +cd ${OPENSTACK_BIFROST_PATH} +bash ./scripts/bifrost-provision.sh echo "-----------------------------------------------------------------------" echo "Info: VM nodes are provisioned!" source $OPENSTACK_BIFROST_PATH/env-vars @@ -130,8 +136,11 @@ echo # - creates log directory # - copies flavor files such as playbook, inventory, and var file #------------------------------------------------------------------------------- + echo "Info: Configuring localhost for openstack-ansible" echo "-----------------------------------------------------------------------" +# NOTE(hwoarang) we need newer ansible to work on the OSA playbooks +sudo pip install --force-reinstall ansible==${XCI_ANSIBLE_PIP_VERSION} cd $XCI_PATH/playbooks ansible-playbook -i inventory configure-localhost.yml echo "-----------------------------------------------------------------------" -- 2.16.6