xci: Move VM provisioning to xci-deploy.sh 37/42337/9
authorMarkos Chandras <mchandras@suse.de>
Mon, 18 Sep 2017 19:16:43 +0000 (20:16 +0100)
committerMarkos Chandras <mchandras@suse.de>
Thu, 21 Sep 2017 20:51:42 +0000 (21:51 +0100)
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 <mchandras@suse.de>
bifrost/scripts/bifrost-provision.sh
xci/playbooks/provision-vm-nodes.yml
xci/xci-deploy.sh

index df05c7c..d4d1f96 100755 (executable)
@@ -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}
 
index 0419dcf..3d88c5c 100644 (file)
       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 }}"
index 6a66134..19f2c18 100755 (executable)
@@ -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 "-----------------------------------------------------------------------"