xci: xci-deploy.sh: Configure dib so VMs match the host 19/41619/2
authorMarkos Chandras <mchandras@suse.de>
Fri, 1 Sep 2017 09:13:45 +0000 (10:13 +0100)
committerMarkos Chandras <mchandras@suse.de>
Sat, 16 Sep 2017 09:32:02 +0000 (10:32 +0100)
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 <mchandras@suse.de>
xci/config/env-vars
xci/xci-deploy.sh

index d8e7124..c399707 100755 (executable)
@@ -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"}
index 5a01772..24936dd 100755 (executable)
@@ -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 ""