You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ch...@apache.org on 2012/07/28 05:41:20 UTC
[3/13] git commit: Checkpoint commit - work in progress. Attempting
to provide devcloud base box build process via veewee and puppet provisining
via Vagrant.
Checkpoint commit - work in progress.
Attempting to provide devcloud base box build process via veewee and
puppet provisining via Vagrant.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/25e0cc9d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/25e0cc9d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/25e0cc9d
Branch: refs/heads/master
Commit: 25e0cc9d7569008f7c592e33b97c8d8568c1a8eb
Parents: 2943dc2
Author: chip.childers@gmail.com <ch...@gmail.com>
Authored: Fri Jul 27 23:35:01 2012 -0400
Committer: chip.childers@gmail.com <ch...@gmail.com>
Committed: Fri Jul 27 23:37:46 2012 -0400
----------------------------------------------------------------------
tools/devcloud/basebuild/Vagrantfile | 51 +++++
.../basebuild/puppet-devcloudinitial/Modulefile | 8 +
.../basebuild/puppet-devcloudinitial/files/grub | 34 +++
.../puppet-devcloudinitial/files/interfaces | 16 ++
.../puppet-devcloudinitial/files/network.conf | 1 +
.../puppet-devcloudinitial/files/xen-defaults | 1 +
.../basebuild/puppet-devcloudinitial/files/xend | 171 +++++++++++++++
.../basebuild/puppet-devcloudinitial/init.pp | 1 +
.../puppet-devcloudinitial/manifests/init.pp | 101 +++++++++
tools/devcloud/devcloudbox/Vagrantfile | 51 +++++
.../devcloudbox/puppet-devcloud/Modulefile | 8 +
.../puppet-devcloud/files/iptables.save | 17 ++
tools/devcloud/devcloudbox/puppet-devcloud/init.pp | 1 +
.../devcloudbox/puppet-devcloud/manifests/init.pp | 32 +++
tools/devcloud/puppet/README | 12 -
.../puppet/puppet-devcloudinitial/Modulefile | 8 -
.../puppet/puppet-devcloudinitial/files/grub | 34 ---
.../puppet/puppet-devcloudinitial/files/interfaces | 16 --
.../puppet-devcloudinitial/files/network.conf | 1 -
.../puppet-devcloudinitial/files/xen-defaults | 1 -
.../puppet/puppet-devcloudinitial/files/xend | 171 ---------------
.../devcloud/puppet/puppet-devcloudinitial/init.pp | 1 -
.../puppet-devcloudinitial/manifests/init.pp | 101 ---------
tools/devcloud/ubuntu_install/README | 1 -
tools/devcloud/vagrant/Vagrantfile | 72 ------
tools/devcloud/vagrant/vagrant.pp | 43 ----
tools/devcloud/veewee/postinstall.sh | 42 ++++
27 files changed, 535 insertions(+), 461 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/Vagrantfile b/tools/devcloud/basebuild/Vagrantfile
new file mode 100644
index 0000000..eee8127
--- /dev/null
+++ b/tools/devcloud/basebuild/Vagrantfile
@@ -0,0 +1,51 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Vagrant::Config.run do |config|
+ config.vm.box = "devcloud"
+ # TODO: Get a URL to host the base image
+ # config.vm.box_url = "http://domain.com/path/to/above.box"
+ config.vm.guest = :xen
+ config.ssh.username = "devcloud"
+
+ # Uncomment this line to enable the console for debugging the
+ # build process.
+ config.vm.boot_mode = :gui
+
+ # Setup port forwarding
+ config.vm.forward_port 22, 2222
+ config.vm.forward_port 8080, 8080
+ config.vm.forward_port 8443, 8443
+ config.vm.forward_port 5901, 5901
+ config.vm.forward_port 8787, 8787
+ config.vm.forward_port 8250, 8250
+
+ # Ensure the VM has the right virtual resources
+ #config.vm.
+
+ config.vm.provision :puppet do |puppet|
+ puppet.manifests_path = "puppet-devcloudinitial"
+ puppet.manifest_file = "init.pp"
+ puppet.with_ssh = true
+ puppet.pp_path = "/etc/puppet"
+ puppet.module_path = "puppet-devcloudinitial"
+ end
+
+end
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile b/tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile
new file mode 100644
index 0000000..b15a29e
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/Modulefile
@@ -0,0 +1,8 @@
+name 'puppet-devcloudinitial'
+version '0.0.1'
+source ''
+author 'Apache Software Foundation'
+license 'Apache 2.0'
+summary 'CloudStack DevCloud initial configuration module'
+description 'Installation and configuration of all prequisites for building a DevCloud image.'
+project_page 'http://cloudstack.org'
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/files/grub
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/files/grub b/tools/devcloud/basebuild/puppet-devcloudinitial/files/grub
new file mode 100644
index 0000000..34613da
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/files/grub
@@ -0,0 +1,34 @@
+# If you change this file, run 'update-grub' afterwards to update
+# /boot/grub/grub.cfg.
+# For full documentation of the options in this file, see:
+# info -f grub -n 'Simple configuration'
+
+GRUB_DEFAULT=2
+#GRUB_HIDDEN_TIMEOUT=0
+GRUB_HIDDEN_TIMEOUT_QUIET=true
+GRUB_TIMEOUT=2
+GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
+GRUB_CMDLINE_LINUX_DEFAULT=""
+GRUB_CMDLINE_LINUX=""
+
+# Uncomment to enable BadRAM filtering, modify to suit your needs
+# This works with Linux (no patch required) and with any kernel that obtains
+# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
+#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
+
+# Uncomment to disable graphical terminal (grub-pc only)
+#GRUB_TERMINAL=console
+
+# The resolution used on graphical terminal
+# note that you can use only modes which your graphic card supports via VBE
+# you can see them in real GRUB with the command `vbeinfo'
+#GRUB_GFXMODE=640x480
+
+# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
+#GRUB_DISABLE_LINUX_UUID=true
+
+# Uncomment to disable generation of recovery mode menu entries
+#GRUB_DISABLE_RECOVERY="true"
+
+# Uncomment to get a beep at grub start
+#GRUB_INIT_TUNE="480 440 1"
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces b/tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces
new file mode 100644
index 0000000..cf88183
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/files/interfaces
@@ -0,0 +1,16 @@
+# The loopback network interface
+auto lo
+iface lo inet loopback
+
+# The primary network interface
+auto xenbr0
+iface xenbr0 inet dhcp
+ gateway 10.0.2.2
+ bridge_ports eth0
+
+
+auto eth0
+iface eth0 inet dhcp
+pre-up iptables-save < /etc/iptables.save
+pre-up /etc/init.d/ebtables load
+
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf b/tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf
new file mode 100644
index 0000000..7096907
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf
@@ -0,0 +1 @@
+bridge
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults b/tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults
new file mode 100644
index 0000000..6886290
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/files/xen-defaults
@@ -0,0 +1 @@
+TOOLSTACK=xapi
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/files/xend
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/files/xend b/tools/devcloud/basebuild/puppet-devcloudinitial/files/xend
new file mode 100644
index 0000000..7fa1077
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/files/xend
@@ -0,0 +1,171 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: xend
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: XEN control daemon
+# Description: XEN control daemon
+### END INIT INFO
+
+PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DESC="Xen daemons"
+
+VERSION=$(xen-version)
+ROOT=/usr/lib/xen-$VERSION
+
+XEND="$ROOT"/bin/xend
+XENCONSOLED="$ROOT"/bin/xenconsoled
+XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid"
+XENSTORED="$ROOT"/bin/xenstored
+XENSTORED_DIR="/var/run/xenstored"
+XENSTORED_PIDFILE="/var/run/xenstore.pid"
+
+[ "$VERSION" ] || exit 0
+[ -x "$XEND" ] || exit 0
+
+[ -r /etc/default/xend ] && . /etc/default/xend
+
+. /lib/init/vars.sh
+. /lib/lsb/init-functions
+
+modules_setup()
+{
+ modprobe xenfs 2>/dev/null
+ modprobe xen-evtchn 2>/dev/null
+ modprobe xen_blkback 2>/dev/null
+ modprobe xen_netback 2>/dev/null
+ modprobe xen_gntdev 2>/dev/null
+}
+
+xenfs_setup()
+{
+ [ -e "/proc/xen/capabilities" ] && return 0
+ log_progress_msg "xenfs"
+ [ -d "/proc/xen" ] || return 1
+ mount -t xenfs xenfs /proc/xen || return 1
+ return 0
+}
+
+capability_check()
+{
+ [ -e "/proc/xen/capabilities" ] || return 1
+ grep -q "control_d" /proc/xen/capabilities || return 1
+ return 0
+}
+
+xend_start()
+{
+ log_progress_msg "xend"
+ $XEND status && return 1
+ $XEND start || return 2
+
+ i=0
+ while [ $i -lt 10 ]; do
+ $XEND status && return 0 || true
+ i=$(($i + 1))
+ sleep 1
+ done
+ return 2
+}
+
+xend_stop()
+{
+ log_progress_msg "xend"
+ $XEND status || return 0
+ $XEND stop || return 1
+}
+
+xenconsoled_start()
+{
+ log_progress_msg "xenconsoled"
+ start-stop-daemon --start --quiet --pidfile "$XENCONSOLED_PIDFILE" --exec "$XENCONSOLED" --test > /dev/null \
+ || return 1
+ start-stop-daemon --start --quiet --pidfile "$XENCONSOLED_PIDFILE" --exec "$XENCONSOLED" -- \
+ $XENCONSOLED_ARGS --pid-file="$XENCONSOLED_PIDFILE" \
+ || return 2
+}
+
+xenstored_start()
+{
+ log_progress_msg "xenstored"
+ start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" --test > /dev/null \
+ || return 1
+ [ -d "$XENSTORED_DIR" ] || mkdir -p "$XENSTORED_DIR"
+ export XENSTORED_ROOTDIR="$XENSTORED_DIR"
+ start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" -- \
+ $XENSTORED_ARGS --pid-file="$XENSTORED_PIDFILE" \
+ || return 2
+}
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DESC"
+ modules_setup
+ xenfs_setup
+ case "$?" in
+ 0) ;;
+ *) log_end_msg 1; exit ;;
+ esac
+ capability_check
+ case "$?" in
+ 0) ;;
+ *) log_end_msg 255; exit ;;
+ esac
+ xenstored_start
+ case "$?" in
+ 0|1) ;;
+ *) log_end_msg 1; exit ;;
+ esac
+ xenconsoled_start
+ case "$?" in
+ 0|1) ;;
+ *) log_end_msg 1; exit ;;
+ esac
+ #xend_start
+ case "$?" in
+ 0|1) ;;
+ *) log_end_msg 1; exit ;;
+ esac
+ log_end_msg 0
+ ;;
+ stop)
+ capability_check
+ case "$?" in
+ 0) ;;
+ *) exit ;;
+ esac
+ log_daemon_msg "Stopping $DESC"
+ #xend_stop
+ case "$?" in
+ 0|1) log_end_msg 0 ;;
+ *) log_end_msg 1 ;;
+ esac
+ ;;
+ restart|force-reload)
+ capability_check
+ case "$?" in
+ 0) ;;
+ *) exit ;;
+ esac
+ log_daemon_msg "Restarting $DESC"
+ #xend_stop
+ case "$?" in
+ 0|1)
+ #xend_start
+ case "$?" in
+ 0) log_end_msg 0 ;;
+ *) log_end_msg 1 ;;
+ esac
+ ;;
+ *) log_end_msg 1 ;;
+ esac
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 3
+ ;;
+esac
+
+exit 0
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/init.pp b/tools/devcloud/basebuild/puppet-devcloudinitial/init.pp
new file mode 100644
index 0000000..bf70cec
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/init.pp
@@ -0,0 +1 @@
+include puppet-devcloudinitial
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp b/tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp
new file mode 100644
index 0000000..8a0a9d0
--- /dev/null
+++ b/tools/devcloud/basebuild/puppet-devcloudinitial/manifests/init.pp
@@ -0,0 +1,101 @@
+class puppet-devcloudinitial {
+
+ package { 'linux-headers-3.2.0-23-generic':
+ ensure => latest,
+ }
+
+ package { 'xen-hypervisor-4.1-i386':
+ ensure => latest,
+ }
+
+ package { 'xcp-xapi':
+ require => Package['xen-hypervisor-4.1-i386'],
+ ensure => latest,
+ }
+
+ file { '/etc/xcp/network.conf':
+ require => Package['xcp-xapi'],
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloudinitial/network.conf',
+ group => '0',
+ mode => '644',
+ owner => '0',
+ }
+
+ file { '/etc/init.d/xend':
+ require => Package['xcp-xapi'],
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloudinitial/xend',
+ group => '0',
+ owner => '0',
+ mode => '755',
+ }
+
+ service { 'xendomains':
+ require => Package['xcp-xapi'],
+ ensure => 'stopped',
+ enable => 'false',
+ }
+
+ file { '/etc/default/grub':
+ require => Package['xen-hypervisor-4.1-i386'],
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloudinitial/grub',
+ group => '0',
+ mode => '644',
+ owner => '0',
+ }
+
+ exec { "/usr/sbin/update-grub":
+ subscribe => File['/etc/default/grub'],
+ refreshonly => true,
+ cwd => '/',
+ }
+
+ file { '/usr/share/qemu':
+ require => Package['xen-hypervisor-4.1-i386'],
+ ensure => 'directory',
+ group => '0',
+ mode => '755',
+ owner => '0',
+ }
+
+ file { '/usr/share/qemu/keymaps':
+ require => File['/usr/share/qemu'],
+ ensure => 'link',
+ group => '0',
+ mode => '777',
+ owner => '0',
+ target => '/usr/share/qemu-linaro/keymaps',
+ }
+
+ file { '/etc/network/interfaces':
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloudinitial/interfaces',
+ group => '0',
+ mode => '644',
+ owner => '0',
+ }
+
+ file { '/etc/default/xen':
+ require => Package['xen-hypervisor-4.1-i386'],
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloudinitial/xen-defaults',
+ group => '0',
+ mode => '644',
+ owner => '0',
+ }
+
+ user { 'root':
+ ensure => 'present',
+ comment => 'root',
+ gid => '0',
+ home => '/root',
+ password => '$6$SCixzUjT$sVs9PwR2g7XdHSLnQW5Zsy2dVpVV3qESFV4Joniusbu3BqWUtKgc91vwEDwPhLqyCYM3kKR1.7G9g2Hu/pTQN/',
+ password_max_age => '99999',
+ password_min_age => '0',
+ shell => '/bin/bash',
+ uid => '0',
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/devcloudbox/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloudbox/Vagrantfile b/tools/devcloud/devcloudbox/Vagrantfile
new file mode 100644
index 0000000..6138926
--- /dev/null
+++ b/tools/devcloud/devcloudbox/Vagrantfile
@@ -0,0 +1,51 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Vagrant::Config.run do |config|
+ config.vm.box = "devcloud"
+ # TODO: Get a URL to host the base image
+ # config.vm.box_url = "http://domain.com/path/to/above.box"
+ config.vm.guest = :xen
+ config.ssh.username = "devcloud"
+
+ # Uncomment this line to enable the console for debugging the
+ # build process.
+ config.vm.boot_mode = :gui
+
+ # Setup port forwarding
+ config.vm.forward_port 22, 2222
+ config.vm.forward_port 8080, 8080
+ config.vm.forward_port 8443, 8443
+ config.vm.forward_port 5901, 5901
+ config.vm.forward_port 8787, 8787
+ config.vm.forward_port 8250, 8250
+
+ # Ensure the VM has the right virtual resources
+ #config.vm.
+
+# config.vm.provision :puppet do |puppet|
+# puppet.manifests_path = "puppet-devcloud"
+# puppet.manifest_file = "init.pp"
+# puppet.with_ssh = true
+# puppet.pp_path = "/etc/puppet"
+# puppet.module_path = "puppet-devcloud"
+# end
+
+end
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/devcloudbox/puppet-devcloud/Modulefile
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloudbox/puppet-devcloud/Modulefile b/tools/devcloud/devcloudbox/puppet-devcloud/Modulefile
new file mode 100644
index 0000000..7da4c4c
--- /dev/null
+++ b/tools/devcloud/devcloudbox/puppet-devcloud/Modulefile
@@ -0,0 +1,8 @@
+name 'puppet-devcloud'
+version '0.0.1'
+source ''
+author 'Apache Software Foundation'
+license 'Apache 2.0'
+summary 'CloudStack DevCloud configuration module'
+description 'Devcloud setup module.'
+project_page 'http://cloudstack.org'
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/devcloudbox/puppet-devcloud/files/iptables.save
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloudbox/puppet-devcloud/files/iptables.save b/tools/devcloud/devcloudbox/puppet-devcloud/files/iptables.save
new file mode 100644
index 0000000..c556398
--- /dev/null
+++ b/tools/devcloud/devcloudbox/puppet-devcloud/files/iptables.save
@@ -0,0 +1,17 @@
+# Generated by iptables-save v1.4.12 on Sat Jul 28 03:18:44 2012
+*mangle
+:PREROUTING ACCEPT [397:23804]
+:INPUT ACCEPT [397:23804]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [238:22820]
+:POSTROUTING ACCEPT [238:22820]
+-A POSTROUTING -p udp -m udp --dport 68 -j CHECKSUM --checksum-fill
+COMMIT
+# Completed on Sat Jul 28 03:18:44 2012
+# Generated by iptables-save v1.4.12 on Sat Jul 28 03:18:44 2012
+*filter
+:INPUT ACCEPT [453:27164]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [273:26476]
+COMMIT
+# Completed on Sat Jul 28 03:18:44 2012
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/devcloudbox/puppet-devcloud/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloudbox/puppet-devcloud/init.pp b/tools/devcloud/devcloudbox/puppet-devcloud/init.pp
new file mode 100644
index 0000000..c3922e3
--- /dev/null
+++ b/tools/devcloud/devcloudbox/puppet-devcloud/init.pp
@@ -0,0 +1 @@
+include puppet-devcloud
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/devcloudbox/puppet-devcloud/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloudbox/puppet-devcloud/manifests/init.pp b/tools/devcloud/devcloudbox/puppet-devcloud/manifests/init.pp
new file mode 100644
index 0000000..b5d75b1
--- /dev/null
+++ b/tools/devcloud/devcloudbox/puppet-devcloud/manifests/init.pp
@@ -0,0 +1,32 @@
+class puppet-devcloud {
+
+ package { 'ebtables':
+ ensure => latest,
+ }
+
+ service { 'ebtables':
+ require => Package['ebtables'],
+ ensure => 'running',
+ enable => 'true',
+ }
+
+ package { 'iptables':
+ ensure => latest,
+ }
+
+ file { '/etc/iptables.save':
+ require => Package['iptables'],
+ ensure => 'file',
+ source => 'puppet:///modules/puppet-devcloud/iptables.save',
+ group => '0',
+ mode => '644',
+ owner => '0',
+ }
+
+ exec { "mac=`ifconfig xenbr0 |grep HWaddr |awk '{print $5}'`; /sbin/ebtables -I FORWARD -d ! $mac -i eth0 -p IPV4 --ip-prot udp --ip-dport 67:68 -j DROP":
+ subscribe => Package['ebtables'],
+ refreshonly => true,
+ cwd => '/',
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/README
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/README b/tools/devcloud/puppet/README
deleted file mode 100644
index f15f440..0000000
--- a/tools/devcloud/puppet/README
+++ /dev/null
@@ -1,12 +0,0 @@
-To use:
-
-Preconfiguration phase -
-- [setup your box in vagrant and place the contents of tools/devcloud/puppet into the box's folder]
-- vagrant up; vagrant ssh
-- sudo bash
-- ln -s /vagrant/puppet-devcloudinitial /etc/puppet/modules/puppet-devcloudinitial
-- cd /vagrant
-- puppet apply --fsconfig fileserver.conf --debug --verbose -e "include puppet-devcloudinitial"
-
-Postconfiguration phase -
-TODO
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/Modulefile
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/Modulefile b/tools/devcloud/puppet/puppet-devcloudinitial/Modulefile
deleted file mode 100644
index b15a29e..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/Modulefile
+++ /dev/null
@@ -1,8 +0,0 @@
-name 'puppet-devcloudinitial'
-version '0.0.1'
-source ''
-author 'Apache Software Foundation'
-license 'Apache 2.0'
-summary 'CloudStack DevCloud initial configuration module'
-description 'Installation and configuration of all prequisites for building a DevCloud image.'
-project_page 'http://cloudstack.org'
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/files/grub
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/files/grub b/tools/devcloud/puppet/puppet-devcloudinitial/files/grub
deleted file mode 100644
index 8813800..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/files/grub
+++ /dev/null
@@ -1,34 +0,0 @@
-# If you change this file, run 'update-grub' afterwards to update
-# /boot/grub/grub.cfg.
-# For full documentation of the options in this file, see:
-# info -f grub -n 'Simple configuration'
-
-GRUB_DEFAULT=0
-#GRUB_HIDDEN_TIMEOUT=0
-GRUB_HIDDEN_TIMEOUT_QUIET=true
-GRUB_TIMEOUT=2
-GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
-GRUB_CMDLINE_LINUX_DEFAULT=""
-GRUB_CMDLINE_LINUX=""
-
-# Uncomment to enable BadRAM filtering, modify to suit your needs
-# This works with Linux (no patch required) and with any kernel that obtains
-# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
-#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
-
-# Uncomment to disable graphical terminal (grub-pc only)
-#GRUB_TERMINAL=console
-
-# The resolution used on graphical terminal
-# note that you can use only modes which your graphic card supports via VBE
-# you can see them in real GRUB with the command `vbeinfo'
-#GRUB_GFXMODE=640x480
-
-# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
-#GRUB_DISABLE_LINUX_UUID=true
-
-# Uncomment to disable generation of recovery mode menu entries
-#GRUB_DISABLE_RECOVERY="true"
-
-# Uncomment to get a beep at grub start
-#GRUB_INIT_TUNE="480 440 1"
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/files/interfaces
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/files/interfaces b/tools/devcloud/puppet/puppet-devcloudinitial/files/interfaces
deleted file mode 100644
index cf88183..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/files/interfaces
+++ /dev/null
@@ -1,16 +0,0 @@
-# The loopback network interface
-auto lo
-iface lo inet loopback
-
-# The primary network interface
-auto xenbr0
-iface xenbr0 inet dhcp
- gateway 10.0.2.2
- bridge_ports eth0
-
-
-auto eth0
-iface eth0 inet dhcp
-pre-up iptables-save < /etc/iptables.save
-pre-up /etc/init.d/ebtables load
-
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/files/network.conf
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/files/network.conf b/tools/devcloud/puppet/puppet-devcloudinitial/files/network.conf
deleted file mode 100644
index 7096907..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/files/network.conf
+++ /dev/null
@@ -1 +0,0 @@
-bridge
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/files/xen-defaults
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/files/xen-defaults b/tools/devcloud/puppet/puppet-devcloudinitial/files/xen-defaults
deleted file mode 100644
index 6886290..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/files/xen-defaults
+++ /dev/null
@@ -1 +0,0 @@
-TOOLSTACK=xapi
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/files/xend
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/files/xend b/tools/devcloud/puppet/puppet-devcloudinitial/files/xend
deleted file mode 100644
index 7fa1077..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/files/xend
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides: xend
-# Required-Start: $remote_fs
-# Required-Stop: $remote_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: XEN control daemon
-# Description: XEN control daemon
-### END INIT INFO
-
-PATH=/usr/lib/xen-common/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DESC="Xen daemons"
-
-VERSION=$(xen-version)
-ROOT=/usr/lib/xen-$VERSION
-
-XEND="$ROOT"/bin/xend
-XENCONSOLED="$ROOT"/bin/xenconsoled
-XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid"
-XENSTORED="$ROOT"/bin/xenstored
-XENSTORED_DIR="/var/run/xenstored"
-XENSTORED_PIDFILE="/var/run/xenstore.pid"
-
-[ "$VERSION" ] || exit 0
-[ -x "$XEND" ] || exit 0
-
-[ -r /etc/default/xend ] && . /etc/default/xend
-
-. /lib/init/vars.sh
-. /lib/lsb/init-functions
-
-modules_setup()
-{
- modprobe xenfs 2>/dev/null
- modprobe xen-evtchn 2>/dev/null
- modprobe xen_blkback 2>/dev/null
- modprobe xen_netback 2>/dev/null
- modprobe xen_gntdev 2>/dev/null
-}
-
-xenfs_setup()
-{
- [ -e "/proc/xen/capabilities" ] && return 0
- log_progress_msg "xenfs"
- [ -d "/proc/xen" ] || return 1
- mount -t xenfs xenfs /proc/xen || return 1
- return 0
-}
-
-capability_check()
-{
- [ -e "/proc/xen/capabilities" ] || return 1
- grep -q "control_d" /proc/xen/capabilities || return 1
- return 0
-}
-
-xend_start()
-{
- log_progress_msg "xend"
- $XEND status && return 1
- $XEND start || return 2
-
- i=0
- while [ $i -lt 10 ]; do
- $XEND status && return 0 || true
- i=$(($i + 1))
- sleep 1
- done
- return 2
-}
-
-xend_stop()
-{
- log_progress_msg "xend"
- $XEND status || return 0
- $XEND stop || return 1
-}
-
-xenconsoled_start()
-{
- log_progress_msg "xenconsoled"
- start-stop-daemon --start --quiet --pidfile "$XENCONSOLED_PIDFILE" --exec "$XENCONSOLED" --test > /dev/null \
- || return 1
- start-stop-daemon --start --quiet --pidfile "$XENCONSOLED_PIDFILE" --exec "$XENCONSOLED" -- \
- $XENCONSOLED_ARGS --pid-file="$XENCONSOLED_PIDFILE" \
- || return 2
-}
-
-xenstored_start()
-{
- log_progress_msg "xenstored"
- start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" --test > /dev/null \
- || return 1
- [ -d "$XENSTORED_DIR" ] || mkdir -p "$XENSTORED_DIR"
- export XENSTORED_ROOTDIR="$XENSTORED_DIR"
- start-stop-daemon --start --quiet --pidfile "$XENSTORED_PIDFILE" --exec "$XENSTORED" -- \
- $XENSTORED_ARGS --pid-file="$XENSTORED_PIDFILE" \
- || return 2
-}
-
-case "$1" in
- start)
- log_daemon_msg "Starting $DESC"
- modules_setup
- xenfs_setup
- case "$?" in
- 0) ;;
- *) log_end_msg 1; exit ;;
- esac
- capability_check
- case "$?" in
- 0) ;;
- *) log_end_msg 255; exit ;;
- esac
- xenstored_start
- case "$?" in
- 0|1) ;;
- *) log_end_msg 1; exit ;;
- esac
- xenconsoled_start
- case "$?" in
- 0|1) ;;
- *) log_end_msg 1; exit ;;
- esac
- #xend_start
- case "$?" in
- 0|1) ;;
- *) log_end_msg 1; exit ;;
- esac
- log_end_msg 0
- ;;
- stop)
- capability_check
- case "$?" in
- 0) ;;
- *) exit ;;
- esac
- log_daemon_msg "Stopping $DESC"
- #xend_stop
- case "$?" in
- 0|1) log_end_msg 0 ;;
- *) log_end_msg 1 ;;
- esac
- ;;
- restart|force-reload)
- capability_check
- case "$?" in
- 0) ;;
- *) exit ;;
- esac
- log_daemon_msg "Restarting $DESC"
- #xend_stop
- case "$?" in
- 0|1)
- #xend_start
- case "$?" in
- 0) log_end_msg 0 ;;
- *) log_end_msg 1 ;;
- esac
- ;;
- *) log_end_msg 1 ;;
- esac
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|force-reload}" >&2
- exit 3
- ;;
-esac
-
-exit 0
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/init.pp b/tools/devcloud/puppet/puppet-devcloudinitial/init.pp
deleted file mode 100644
index bf70cec..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/init.pp
+++ /dev/null
@@ -1 +0,0 @@
-include puppet-devcloudinitial
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/puppet/puppet-devcloudinitial/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/puppet/puppet-devcloudinitial/manifests/init.pp b/tools/devcloud/puppet/puppet-devcloudinitial/manifests/init.pp
deleted file mode 100644
index 79988c6..0000000
--- a/tools/devcloud/puppet/puppet-devcloudinitial/manifests/init.pp
+++ /dev/null
@@ -1,101 +0,0 @@
-class puppet-devcloudinitial {
-
- package { 'linux-headers-3.2.0-23-generic':
- ensure => latest,
- }
-
- package { 'xen-hypervisor-4.1-amd64':
- ensure => latest,
- }
-
- package { 'xcp-xapi':
- require => Package['xen-hypervisor-4.1-amd64'],
- ensure => latest,
- }
-
- file { '/etc/xcp/network.conf':
- require => Package['xcp-xapi'],
- ensure => 'file',
- source => 'puppet:///modules/puppet-devcloudinitial/network.conf',
- group => '0',
- mode => '644',
- owner => '0',
- }
-
- file { '/etc/init.d/xend':
- require => Package['xcp-xapi'],
- ensure => 'file',
- source => 'puppet:///modules/puppet-devcloudinitial/xend',
- group => '0',
- owner => '0',
- mode => '755',
- }
-
- service { 'xendomains':
- require => Package['xcp-xapi'],
- ensure => 'stopped',
- enable => 'false',
- }
-
- file { '/etc/default/grub':
- require => Package['xen-hypervisor-4.1-amd64'],
- ensure => 'file',
- source => 'puppet:///modules/puppet-devcloudinitial/grub',
- group => '0',
- mode => '644',
- owner => '0',
- }
-
- exec { "/usr/sbin/update-grub":
- subscribe => File['/etc/default/grub'],
- refreshonly => true,
- cwd => '/',
- }
-
- file { '/usr/share/qemu':
- require => Package['xen-hypervisor-4.1-amd64'],
- ensure => 'directory',
- group => '0',
- mode => '755',
- owner => '0',
- }
-
- file { '/usr/share/qemu/keymaps':
- require => File['/usr/share/qemu'],
- ensure => 'link',
- group => '0',
- mode => '777',
- owner => '0',
- target => '/usr/share/qemu-linaro/keymaps',
- }
-
- file { '/etc/network/interfaces':
- ensure => 'file',
- source => 'puppet:///modules/puppet-devcloudinitial/interfaces',
- group => '0',
- mode => '644',
- owner => '0',
- }
-
- file { '/etc/default/xen':
- require => Package['xen-hypervisor-4.1-amd64'],
- ensure => 'file',
- source => 'puppet:///modules/puppet-devcloudinitial/xen-defaults',
- group => '0',
- mode => '644',
- owner => '0',
- }
-
- user { 'root':
- ensure => 'present',
- comment => 'root',
- gid => '0',
- home => '/root',
- password => '$6$SCixzUjT$sVs9PwR2g7XdHSLnQW5Zsy2dVpVV3qESFV4Joniusbu3BqWUtKgc91vwEDwPhLqyCYM3kKR1.7G9g2Hu/pTQN/',
- password_max_age => '99999',
- password_min_age => '0',
- shell => '/bin/bash',
- uid => '0',
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/ubuntu_install/README
----------------------------------------------------------------------
diff --git a/tools/devcloud/ubuntu_install/README b/tools/devcloud/ubuntu_install/README
deleted file mode 100644
index 7432dbc..0000000
--- a/tools/devcloud/ubuntu_install/README
+++ /dev/null
@@ -1 +0,0 @@
-Nothing in this directory yet, but it will contain the scripts and preconfiguration files to build the basic Ubuntu 12.04 server used in devcloud.
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/vagrant/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/vagrant/Vagrantfile b/tools/devcloud/vagrant/Vagrantfile
deleted file mode 100644
index d2a9c99..0000000
--- a/tools/devcloud/vagrant/Vagrantfile
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-Vagrant::Config.run do |config|
- config.vm.box = "devcloudbase-ubuntu-12-04-64bit"
- # TODO: Get a URL to host the base image
- # config.vm.box_url = "http://domain.com/path/to/above.box"
-
- # Uncomment this line to enable the console for debugging the
- # build process.
- #config.vm.boot_mode = :gui
-
- # Setup port forwarding
- config.vm.forward_port 22, 2222
- config.vm.forward_port 8080, 8080
- config.vm.forward_port 8443, 8443
- config.vm.forward_port 5901, 5901
- config.vm.forward_port 8787, 8787
- config.vm.forward_port 8250, 8250
-
- # Ensure the VM has the right virtual resources
- #config.vm.
-
- config.vm.provision :puppet do |puppet|
- puppet.manifests_path = "puppet-devcloudinitial"
- puppet.manifest_file = "init.pp"
- puppet.with_ssh = true
- puppet.pp_path = "/etc/puppet"
- puppet.module_path = "puppet-devcloudinitial"
- end
-
- # Enable provisioning with Puppet stand alone. Puppet manifests
- # are contained in a directory path relative to this Vagrantfile.
- # You will need to create the manifests directory and a manifest in
- # the file my_box.pp in the manifests_path directory.
- #
- # An example Puppet manifest to provision the message of the day:
- #
- # # group { "puppet":
- # # ensure => "present",
- # # }
- # #
- # # File { owner => 0, group => 0, mode => 0644 }
- # #
- # # file { '/etc/motd':
- # # content => "Welcome to your Vagrant-built virtual machine!
- # # Managed by Puppet.\n"
- # # }
- #
- # config.vm.provision :puppet do |puppet|
- # puppet.manifests_path = "manifests"
- # puppet.manifest_file = "my_box.pp"
- # end
-
-end
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/vagrant/vagrant.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/vagrant/vagrant.pp b/tools/devcloud/vagrant/vagrant.pp
deleted file mode 100644
index 1be6626..0000000
--- a/tools/devcloud/vagrant/vagrant.pp
+++ /dev/null
@@ -1,43 +0,0 @@
-group { 'vagranttest':
- ensure => 'present',
- gid => '5000',
-}
-
-group { 'admin':
- ensure => 'present',
- gid => '1002',
-}
-
-user { 'vagranttest':
- ensure => 'present',
- comment => 'vagrant,,,',
- gid => '5000',
- groups => ['adm', 'cdrom', 'dip', 'plugdev', 'lpadmin', 'sambashare', 'admin'],
- home => '/home/vagranttest',
- shell => '/bin/bash',
- uid => '5000',
-}
-
-file { '/home/vagranttest':
- ensure => 'directory',
- group => '1002',
- mode => '755',
- owner => '5000',
-}
-
-file { '/home/vagranttest/.ssh':
- ensure => 'directory',
- group => '1002',
- mode => '775',
- owner => '5000',
-}
-
-$auth_key = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
-
-file { '/home/vagranttest/.ssh/authorized_keys':
- ensure => 'file',
- content => $auth_key,
- group => '1002',
- mode => '664',
- owner => '5000',
-}
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/25e0cc9d/tools/devcloud/veewee/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/veewee/postinstall.sh b/tools/devcloud/veewee/postinstall.sh
new file mode 100644
index 0000000..a650501
--- /dev/null
+++ b/tools/devcloud/veewee/postinstall.sh
@@ -0,0 +1,42 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+apt-get -y update
+apt-get -y upgrade
+apt-get -y install vim
+apt-get -y install ruby
+apt-get -y install rubygems
+apt-get -y install puppet
+apt-get clean
+
+# Setup sudo to allow no-password sudo for "admin"
+groupadd -r admin
+usermod -a -G admin devcloud
+sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
+sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
+
+mkdir /home/devcloud/.ssh
+chmod 700 /home/devcloud/.ssh
+cd /home/devcloud/.ssh
+wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
+chmod 600 /home/devcloud/.ssh/authorized_keys
+chown -R devcloud /home/devcloud/.ssh
+
+# Zero out the free space to save space in the final image:
+dd if=/dev/zero of=/EMPTY bs=1M
+rm -f /EMPTY
+