Extend install script for Ubuntu

PRODX-29493

Change-Id: I2bd5b4d99ac85d2a8ea56b339e7240836c24d004
diff --git a/install.sh b/install.sh
index 1d1b53b..933e680 100755
--- a/install.sh
+++ b/install.sh
@@ -2,11 +2,32 @@
 
 set -e
 
-# Prepare RHEL image for bootstrap on VSPHERE
+# Prepare VM image for bootstrap on VSPHERE
 
 : "${DOWNLOAD_INSTALL:="true"}"
 
-yum -y install open-vm-tools net-tools perl cloud-init
+PACKAGE_LIST="open-vm-tools net-tools perl cloud-init coreutils vim rsync"
+
+# If Debian:
+if [ ! -e /etc/system-release ]; then
+    apt-get update
+    apt-get install ${PACKAGE_LIST} -y
+
+    # No need to patch cloud-init datasource, just enable it.
+    mkdir -p /etc/cloud/cloud.cfg.d
+    cat << EOF >> /etc/cloud/cloud.cfg.d/99_mcc.cfg
+datasource_list: [ VMware ]
+package_update: false
+package_upgrade: false
+apt:
+  preserve_sources_list: true
+EOF
+
+   exit 0
+fi
+
+# If RHEL/Centos:
+yum -y install ${PACKAGE_LIST}
 
 # The script to lookup the path to the cloud-init's datasource directory, "sources".
 PY_SCRIPT='import os; from cloudinit import sources; print(os.path.dirname(sources.__file__));'