summaryrefslogtreecommitdiffstats
path: root/xci/infra/bifrost/infra-provision.sh
diff options
context:
space:
mode:
authorMarkos Chandras <mchandras@suse.de>2018-03-15 16:51:37 +0000
committerMarkos Chandras <mchandras@suse.de>2018-03-20 08:45:22 +0000
commit77ab4eeda0f42616c63fa3d3baef9063a1e5741e (patch)
treed7049fa3815d463d06a3a38016137e9884373416 /xci/infra/bifrost/infra-provision.sh
parentc5d83347c1550efe2e7eb4e114ac2fc0a18f6e6a (diff)
Add initial support for multiple infra deployers
bifrost is currently the only way to deploy the infrastructure but in the future other solutions will be added so we need to do some preparation for XCI integration. Change-Id: I961dd42157c924d88747074ddba6a318f8b537ac Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/infra/bifrost/infra-provision.sh')
-rw-r--r--xci/infra/bifrost/infra-provision.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/xci/infra/bifrost/infra-provision.sh b/xci/infra/bifrost/infra-provision.sh
new file mode 100644
index 00000000..f847e66d
--- /dev/null
+++ b/xci/infra/bifrost/infra-provision.sh
@@ -0,0 +1,25 @@
+#-------------------------------------------------------------------------------
+# Start provisioning VM nodes
+#-------------------------------------------------------------------------------
+# This playbook
+# - removes directories that were created by the previous xci run
+# - clones opnfv/releng-xci and openstack/bifrost repositories
+# - combines opnfv/releng-xci and openstack/bifrost scripts/playbooks
+# - destroys VMs, removes ironic db, leases, logs
+# - creates and provisions VMs for the chosen flavor
+#-------------------------------------------------------------------------------
+BIFROST_ROOT_DIR="$(dirname $(realpath ${BASH_SOURCE[0]}))"
+
+echo "Info: Starting provisining VM nodes using openstack/bifrost"
+echo "-------------------------------------------------------------------------"
+# We are using sudo so we need to make sure that env_reset is not present
+sudo sed -i "s/^Defaults.*env_reset/#&/" /etc/sudoers
+cd $BIFROST_ROOT_DIR
+sudo -E bash ./scripts/destroy-env.sh
+cd $BIFROST_ROOT_DIR/playbooks/
+ansible-playbook ${XCI_ANSIBLE_PARAMS} -i "localhost," bootstrap-bifrost.yml
+cd ${XCI_CACHE}/repos/bifrost
+bash ./scripts/bifrost-provision.sh
+echo "-----------------------------------------------------------------------"
+echo "Info: VM nodes are provisioned!"
+echo "-----------------------------------------------------------------------"