From f819f91a39ad781d8e7c20fe4672260b4f98e5f3 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 1 Sep 2017 10:13:45 +0100 Subject: [PATCH] xci: xci-deploy.sh: Configure dib so VMs match the host In preparation for adding SUSE support, we need to configure the dib build process to build images which match the host's OS. Change-Id: I4944245d526f916b2033abc5d219fa7a69db54ab Signed-off-by: Markos Chandras --- xci/config/env-vars | 5 ----- xci/xci-deploy.sh | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/xci/config/env-vars b/xci/config/env-vars index d8e71244..c399707b 100755 --- a/xci/config/env-vars +++ b/xci/config/env-vars @@ -17,10 +17,5 @@ export JOB_NAME=${JOB_NAME:-false} # Overall, it's better to use what OSA supports so we can use new features. export XCI_ANSIBLE_PIP_VERSION=2.3.2.0 export ANSIBLE_HOST_KEY_CHECKING=False -export DISTRO=${DISTRO:-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,sudo,language-pack-en,iputils-ping,rsyslog,curl,python,debootstrap,ifenslave,ifenslave-2.6,lsof,lvm2,tcpdump,nfs-kernel-server,chrony,iptables"} -export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"} # subject of the certificate export XCI_SSL_SUBJECT=${XCI_SSL_SUBJECT:-"/C=US/ST=California/L=San Francisco/O=IT/CN=xci.releng.opnfv.org"} diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index 5a01772f..24936dd5 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -67,6 +67,30 @@ echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- source file/install-ansible.sh +# 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,chrony,iptables,nfs-kernel-server}" + 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,nfs-kernel-server}" + 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,nfs-kernel-server}" + export EXTRA_DIB_ELEMENTS="${EXTRA_DIB_ELEMETS:-openssh-server}" + ;; +esac + # There is no CentOS or openSUSE support at all if [[ $OS_FAMILY != Debian ]]; then echo "" -- 2.16.6