From d3116e3182ebae9d40544060a0318cbc382e388c Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 28 Dec 2017 12:00:08 +0000 Subject: xci: Decouple VM distribution from host OS Introduce a new XCI_DISTRO variable to select the distribution to deploy on the VMs in order to make deployments more flexible and decouple the VM OS selection from the host one. The default value for this new variable is to match the host OS but users can always set it to one of the supported distributions. We can now simply execute the install-ansible.sh script instead of sourcing it in order to keep the environment as clean as possible. Change-Id: Ia74eb0422f983848cde0fb7b220ea1035dfa78bc Signed-off-by: Markos Chandras --- xci/xci-deploy.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'xci/xci-deploy.sh') diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index fa03ef8d..e0b31ab9 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -99,24 +99,22 @@ echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- echo "Info: Installing Ansible from pip" echo "-------------------------------------------------------------------------" -source files/install-ansible.sh +bash files/install-ansible.sh echo "-------------------------------------------------------------------------" -# 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 +case ${XCI_DISTRO,,} in # These should ideally match the CI jobs - debian) + ubuntu) 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}" ;; - redhat) + centos) 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}" ;; - suse) + opensuse) 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}" @@ -124,7 +122,7 @@ case ${OS_FAMILY,,} in esac # There is no CentOS support at all -if [[ $OS_FAMILY == RedHat ]]; then +if [[ ${XCI_DISTRO,,} == centos ]]; then echo "" echo "Error: Sorry, only Ubuntu and SUSE hosts are supported for now!" echo "Error: CentOS 7 support is still work in progress." -- cgit 1.2.3-korg