Add initial Packer definitions

Copy over the Packer definitions from ONOS since we've been asked to set
up the builders the same way initially.

Change-Id: I8c6e3cad05e4d4341ac58498d36810dac06f687f
Signed-off-by: Linux Foundation Administrators <collab-it+onlab@linuxfoundation.org>
diff --git a/packer/provision/docker.sh b/packer/provision/docker.sh
new file mode 100644
index 0000000..d476f66
--- /dev/null
+++ b/packer/provision/docker.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# vim: sw=4 ts=4 sts=4 et :
+
+# force any errors to cause the script and job to end in failure
+set -xeu -o pipefail
+
+rh_changes() {
+    echo "---> RH changes"
+    # install docker and enable it
+    echo "---> Installing docker"
+    yum install -y docker supervisor bridge-utils
+    systemctl enable docker
+
+    # configure docker networking so that it does not conflict with LF
+    # internal networks
+    cat <<EOL > /etc/sysconfig/docker-network
+# /etc/sysconfig/docker-network
+DOCKER_NETWORK_OPTIONS='--bip=10.250.0.254/24'
+EOL
+    # configure docker daemon to listen on port 5555 enabling remote
+    # managment
+    sed -i -e "s#='--selinux-enabled'#='--selinux-enabled -H unix:///var/run/docker.sock -H tcp://0.0.0.0:5555'#g" /etc/sysconfig/docker
+
+    # docker group doesn't get created by default for some reason
+    groupadd docker
+
+    # Install python dependencies
+    yum install -y python-{devel,virtualenv,setuptools,pip}
+}
+
+ubuntu_changes() {
+    echo "---> Ubuntu changes"
+}
+
+OS=$(/usr/bin/facter operatingsystem)
+case "$OS" in
+    CentOS|Fedora|RedHat)
+        rh_changes
+    ;;
+    Ubuntu)
+        ubuntu_changes
+    ;;
+    *)
+        echo "${OS} has no configuration changes"
+    ;;
+esac
+
+echo "***************************************************"
+echo "*   PLEASE RELOAD THIS VAGRANT BOX BEFORE USE     *"
+echo "***************************************************"