summaryrefslogtreecommitdiffstats
path: root/prototypes/xci/xci-deploy.sh
diff options
context:
space:
mode:
authorFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-03-31 15:02:16 +0200
committerFatih Degirmenci <fatih.degirmenci@ericsson.com>2017-03-31 16:34:44 +0200
commite40c112a8127e2601e0e98e00598010120c8d41a (patch)
treead9a33982dfd187f06b0e26fdf91e135976ae6be /prototypes/xci/xci-deploy.sh
parenta2b9b34651438563c5f677faa56d9cf61b09674d (diff)
xci: Create playbook to destroy, create and provision VM nodes
This change moves preparation (cloning repos, combining opnfv/bifrost with openstack/bifrost), destroying and creating VM nodes from the script into a separate playbook. This requires the host to have ansible installed. The version of ansible to install using pip currently matches to what bifrost uses but it is hardcoded and needs to be fixed properly. The reason for having this as a playbook to simplify the script and increase the reuse. This playbook will be used for - developer sandbox - periodic bifrost jobs to run against latest on given branch and promoting bifrost sha1 to pin later on - daily jobs to run using pinned versions of bifrost Change-Id: I033f12290dfea19d4c74be80eea7203211c0369e Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'prototypes/xci/xci-deploy.sh')
-rwxr-xr-xprototypes/xci/xci-deploy.sh33
1 files changed, 4 insertions, 29 deletions
diff --git a/prototypes/xci/xci-deploy.sh b/prototypes/xci/xci-deploy.sh
index 277206dc7..c5cfab36d 100755
--- a/prototypes/xci/xci-deploy.sh
+++ b/prototypes/xci/xci-deploy.sh
@@ -36,41 +36,16 @@ echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION"
echo "-------------------------------------------------------------------------"
#-------------------------------------------------------------------------------
-# Cleanup the leftovers from the previous deployment
+# install ansible on localhost
#-------------------------------------------------------------------------------
-echo "Info: Cleaning up the previous deployment"
-$XCI_PATH/../bifrost/scripts/destroy-env.sh > /dev/null 2>&1
-/bin/rm -rf /opt/releng /opt/bifrost /opt/openstack-ansible
-
-#-------------------------------------------------------------------------------
-# Clone the repositories and checkout the versions
-#-------------------------------------------------------------------------------
-echo "Info: Cloning repositories and checking out versions"
-git clone --quiet $OPNFV_RELENG_GIT_URL $OPNFV_RELENG_PATH && \
- cd $OPNFV_RELENG_PATH
-echo "Info: Cloned opnfv/releng. HEAD currently points at"
-echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
-git clone --quiet $OPENSTACK_BIFROST_GIT_URL $OPENSTACK_BIFROST_PATH && \
- cd $OPENSTACK_BIFROST_PATH
-echo "Info: Cloned openstack/bifrost. HEAD currently points at"
-echo " $(git show --oneline -s --pretty=format:'%h - %s (%cr) <%an>')"
-
-#-------------------------------------------------------------------------------
-# Combine opnfv and upstream scripts/playbooks
-#-------------------------------------------------------------------------------
-echo "Info: Combining opnfv/releng and opestack/bifrost scripts/playbooks"
-/bin/cp -rf $OPNFV_RELENG_PATH/prototypes/bifrost/* $OPENSTACK_BIFROST_PATH/
+pip install ansible==$XCI_ANSIBLE_PIP_VERSION
#-------------------------------------------------------------------------------
# Start provisioning VM nodes
#-------------------------------------------------------------------------------
echo "Info: Starting provisining VM nodes using openstack/bifrost"
-echo " This might take between 10 to 20 minutes depending on the flavor and the host"
echo "-------------------------------------------------------------------------"
-cd $OPENSTACK_BIFROST_PATH
-STARTTIME=$(date +%s)
-./scripts/bifrost-provision.sh
-ENDTIME=$(date +%s)
+cd $XCI_PATH/playbooks
+ansible-playbook $ANSIBLE_VERBOSITY -i inventory provision-vm-nodes.yml
echo "-----------------------------------------------------------------------"
echo "Info: VM nodes are provisioned!"
-echo "Info: It took $(($ENDTIME - $STARTTIME)) seconds to provising the VM nodes"