summaryrefslogtreecommitdiffstats
path: root/xci/xci-deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'xci/xci-deploy.sh')
-rwxr-xr-xxci/xci-deploy.sh41
1 files changed, 37 insertions, 4 deletions
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 5a01772f..19f2c18a 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -67,11 +67,35 @@ echo "-------------------------------------------------------------------------"
#-------------------------------------------------------------------------------
source file/install-ansible.sh
-# There is no CentOS or openSUSE support at all
-if [[ $OS_FAMILY != Debian ]]; then
+# Make the VMs match the host. If we need to make this configurable
+# then this logic has to be moved outside this file
+case ${OS_FAMILY,,} in
+ # These should ideally match the CI jobs
+ debian)
+ export DIB_OS_RELEASE="${DIB_OS_RELEASE:-xenial}"
+ export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-ubuntu-minimal}"
+ export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl,iptables}"
+ export EXTRA_DIB_ELEMENTS="${EXTRA_DIB_ELEMENTS:-openssh-server}"
+ ;;
+ redhat)
+ export DIB_OS_RELEASE="${DIB_OS_RELEASE:-7}"
+ export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-centos-minimal}"
+ export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vim,less,bridge-utils,iputils,rsyslog,curl,iptables}"
+ export EXTRA_DIB_ELEMENTS="${EXTRA_DIB_ELEMENTS:-openssh-server}"
+ ;;
+ suse)
+ export DIB_OS_RELEASE="${DIB_OS_RELEASE:-42.3}"
+ export DIB_OS_ELEMENT="${DIB_OS_ELEMENT:-opensuse-minimal}"
+ export DIB_OS_PACKAGES="${DIB_OS_PACKAGES:-vim,less,bridge-utils,iputils,rsyslog,curl,iptables}"
+ export EXTRA_DIB_ELEMENTS="${EXTRA_DIB_ELEMETS:-openssh-server}"
+ ;;
+esac
+
+# There is no CentOS support at all
+if [[ $OS_FAMILY == RedHat ]]; then
echo ""
- echo "Error: Sorry, only Ubuntu hosts are supported for now!"
- echo "Error: CentOS7 and openSUSE Leap support is still work in progress."
+ echo "Error: Sorry, only Ubuntu and SUSE hosts are supported for now!"
+ echo "Error: CentOS 7 support is still work in progress."
echo ""
exit 1
fi
@@ -91,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
@@ -106,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 "-----------------------------------------------------------------------"