Refresh docker image definition 70/26670/1
authorAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 8 Sep 2015 18:21:20 +0000 (11:21 -0700)
committerAndrew Grimberg <agrimberg@linuxfoundation.org>
Tue, 8 Sep 2015 18:21:20 +0000 (11:21 -0700)
Refresh the docker image definition.

* rename the definition from ovsdb-docker to just docker
* clean up the scripts to be multi-distro aware
* definition is still only Fedora capable but it should be easier to
  configure another distro to do docker as well.

Change-Id: If295ed05e1b90e8be516099a7aade0c77b7314f7
Signed-off-by: Andrew Grimberg <agrimberg@linuxfoundation.org>
vagrant/docker/README.md [moved from vagrant/ovsdb-docker/README.md with 57% similarity]
vagrant/docker/Vagrantfile [moved from vagrant/ovsdb-docker/Vagrantfile with 88% similarity]
vagrant/docker/bootstrap.sh [new file with mode: 0644]
vagrant/docker/system_reseal.sh [moved from vagrant/ovsdb-docker/system_reseal.sh with 97% similarity]
vagrant/lf-networking/configure_lf_infra.sh
vagrant/ovsdb-docker/bootstrap.sh [deleted file]

similarity index 57%
rename from vagrant/ovsdb-docker/README.md
rename to vagrant/docker/README.md
index a8e8291adeea3d7b11b5d604f6ead7da6ea1ef3c..a66f641b3d298ba93be31d9d3ae269fd4a613b90 100644 (file)
@@ -1,8 +1,7 @@
-ovsdb-docker can be used to take an already converted Rackspace native
-base image into a usuable docker ready image (tested against ovsdb hence
-the name)
+The docker Vagrant can be used to take an already converted Rackspace native
+base image into a usuable docker ready image
 
-Please see the rackspace-convert-base vagrant setup for creation of the
+Please see the baseline vagrant setup for creation of the
 needed base image.
 
 This vagrant expects (by default) a personal Rackspace image named
@@ -11,11 +10,11 @@ This vagrant expects (by default) a personal Rackspace image named
 
 To spin up and utilize.
 
-$ RSIMAGE='${baseimagename}' vagrant up --provider=rackspace
+$ RSIMAGE="${baseimagename}" vagrant up --provider=rackspace
 
 Will execute this vagrant against a differently named base image
 
-$ RSRESEAL=true vagrant up --provider=rackspace
+$ RSIMAGE="${baseimagename}" RSRESEAL=true vagrant up --provider=rackspace
 
 NOTE: resealing will cause the vagrant to run the resealing operation.
 This operation will intentionally destroy current SSH pubkeys installed
similarity index 88%
rename from vagrant/ovsdb-docker/Vagrantfile
rename to vagrant/docker/Vagrantfile
index 8e543d5ef0a44679dcd8f8f708570dcdac0bbdb4..278a0581d9ac7aa4a5c8d7f4dcb1642d6538fe59 100644 (file)
@@ -14,12 +14,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
   # so use that
   config.ssh.username = 'root'
 
-  # Fedora and EL systems default to requiring tty for sudo
-  # This should have been disabled with the Vagrant ready
-  # base box conversion (see rackspace-convert-base vagrant)
-  # but just to be safe
-  config.ssh.pty = true
-
   # make sure to set the following in your
   # ~/.vagrant.d/boxes/dummy/0/rackspace/Vagrantfile
   # rs.username
diff --git a/vagrant/docker/bootstrap.sh b/vagrant/docker/bootstrap.sh
new file mode 100644 (file)
index 0000000..3ba1164
--- /dev/null
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+# vim: sw=4 ts=4 sts=4 et :
+
+fedora_changes() {
+    # make sure we're fully updated
+    echo "---> Updating OS"
+    dnf clean all
+    dnf update -y -q
+
+    # install docker and enable it
+    echo "---> Installing docker"
+    dnf 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
+
+    # docker group doesn't get created by default for some reason
+    groupadd docker
+}
+
+el_changes() {
+    # make sure we're fully updated
+    echo "---> Updating OS"
+    yum clean all
+    yum update -q -y
+}
+
+ubuntu_changes() {
+    # make sure we're fully updated
+    echo "---> Updating OS"
+    apt-get update
+    apt-get upgrade -y -qq
+}
+
+OS=`/usr/bin/facter operatingsystem`
+case "$OS" in
+    Fedora)
+        fedora_changes
+    ;;
+    Centos|RedHat)
+        el_changes
+    ;;
+    Ubuntu)
+        ubuntu_changes
+    ;;
+    *)
+        echo "${OS} has no configuration changes"
+    ;;
+esac
+
+echo "***************************************************"
+echo "*   PLEASE RELOAD THIS VAGRANT BOX BEFORE USE     *"
+echo "***************************************************"
similarity index 97%
rename from vagrant/ovsdb-docker/system_reseal.sh
rename to vagrant/docker/system_reseal.sh
index 07a0531777d120e61a4d1fd83ac5a85009f86e2a..87d60c30582aea2c0175b459ec40da351e827a27 100644 (file)
@@ -12,7 +12,7 @@ if [ -f /.autorelabel ]; then
 fi
 
 # clean-up from any prior cloud-init networking
-rm -rf /etc/sysconfig/network-scripts/{ifcfg,route}-eth*
+rm -rf /etc/sysconfig/network-scripts/ifcfg-eth*
 
 rm -rf /etc/Pegasus/*.cnf /etc/Pegasus/*.crt /etc/Pegasus/*.csr /etc/Pegasus/*.pem /etc/Pegasus/*.srl /root/anaconda-ks.cfg /root/anaconda-post.log /root/initial-setup-ks.cfg /root/install.log /root/install.log.syslog /var/cache/fontconfig/* /var/cache/gdm/* /var/cache/man/* /var/lib/AccountService/users/* /var/lib/fprint/* /var/lib/logrotate.status /var/log/*.log* /var/log/BackupPC/LOG /var/log/ConsoleKit/* /var/log/anaconda.syslog /var/log/anaconda/* /var/log/apache2/*_log /var/log/apache2/*_log-* /var/log/apt/* /var/log/aptitude* /var/log/audit/* /var/log/btmp* /var/log/ceph/*.log /var/log/chrony/*.log /var/log/cron* /var/log/cups/*_log /var/log/debug* /var/log/dmesg* /var/log/exim4/* /var/log/faillog* /var/log/gdm/* /var/log/glusterfs/*glusterd.vol.log /var/log/glusterfs/glusterfs.log /var/log/httpd/*log /var/log/installer/* /var/log/jetty/jetty-console.log /var/log/journal/* /var/log/lastlog* /var/log/libvirt/libvirtd.log /var/log/libvirt/lxc/*.log /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/lightdm/* /var/log/mail/* /var/log/maillog* /var/log/messages* /var/log/ntp /var/log/ntpstats/* /var/log/ppp/connect-errors /var/log/rhsm/* /var/log/sa/* /var/log/secure* /var/log/setroubleshoot/*.log /var/log/spooler* /var/log/squid/*.log /var/log/syslog* /var/log/tallylog* /var/log/tuned/tuned.log /var/log/wtmp* /var/named/data/named.run
 
index f515750a99f169702a295436eee5e3d57e9d7497..781b4f5264977fc60364e515f56e34fcac5f55d1 100644 (file)
@@ -27,7 +27,7 @@ all_systems() {
 
 rh_systems_init() {
     # remove current networking configurations
-    rm -f /etc/sysconfig/network-scripts/ifcfg-{eth,docker}*
+    rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
 }
 
 rh_systems_post() {
diff --git a/vagrant/ovsdb-docker/bootstrap.sh b/vagrant/ovsdb-docker/bootstrap.sh
deleted file mode 100644 (file)
index 876cdb1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-yum clean all
-# Add the ODL yum repo
-#yum install -q -y https://nexus.opendaylight.org/content/repositories/opendaylight-yum-epel-6-x86_64/rpm/opendaylight-release/0.1.0-1.el6.noarch/opendaylight-release-0.1.0-1.el6.noarch.rpm
-yum update -q -y
-
-yum install -q -y java-1.7.0-openjdk-devel docker-io supervisor git
-
-systemctl enable docker.service
-
-echo "***************************************************"
-echo "*   PLEASE RELOAD THIS VAGRANT BOX BEFORE USE     *"
-echo "***************************************************"