You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bf...@apache.org on 2012/12/19 23:04:27 UTC

[24/50] [abbrv] devcloud: Move build scripts to src/, fix README and rm Gemfile.lock

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/Vagrantfile b/tools/devcloud/src/Vagrantfile
new file mode 100644
index 0000000..3f0d904
--- /dev/null
+++ b/tools/devcloud/src/Vagrantfile
@@ -0,0 +1,58 @@
+# -*- 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.network :hostonly, "192.168.56.10", :auto_config => false
+  #config.vm.box = "devcloud"
+  config.vm.box = "devcloudbase-xen"
+  #config.vm.box_url = "http://basho-cloudstack.s3.amazonaws.com/devcloud.box"
+
+  config.vm.guest = :xen
+  config.ssh.username = "devcloud"
+  config.vm.host_name = "devcloud.local"
+  # 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, 7222
+  config.vm.forward_port 3306, 3306
+  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
+  config.vm.forward_port 8096, 8096
+  config.vm.forward_port 7080, 7080
+  # Ensure the VM has the right virtual resources
+  #config.vm.
+  config.vm.customize ["modifyvm", :id, "--memory", 2048]
+  config.vm.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"]
+  config.vm.provision :shell, :path => "waitforxe.sh"
+  config.vm.provision :puppet do |puppet|
+     puppet.with_ssh       = true
+     puppet.manifests_path = File.join 'puppet', 'manifests'
+     puppet.module_path    = File.join 'puppet', 'modules', 'devcloud'
+     puppet.manifest_file  = 'vagrant-devcloud.pp'
+     puppet.options        = ['--pluginsync', '--trace', '--debug', '--verbose']
+  end
+
+
+end

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/boxit.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/boxit.sh b/tools/devcloud/src/boxit.sh
new file mode 100755
index 0000000..ccf28c6
--- /dev/null
+++ b/tools/devcloud/src/boxit.sh
@@ -0,0 +1,5 @@
+#! /bin/bash -ex
+
+vagrant halt
+vagrant package default --output devcloud.box
+vagrant box add devcloud devcloud.box -f

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxer.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxer.sh b/tools/devcloud/src/deps/boxer.sh
new file mode 100755
index 0000000..29b3cb2
--- /dev/null
+++ b/tools/devcloud/src/deps/boxer.sh
@@ -0,0 +1,168 @@
+#! /bin/bash
+
+# Load RVM into a shell session *as a function*
+if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
+# First try to load from a user install
+  source "$HOME/.rvm/scripts/rvm"
+elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
+# Then try to load from a root install
+  source "/usr/local/rvm/scripts/rvm"
+else
+  printf "ERROR: An RVM installation was not found.\n"
+fi
+
+BASEDIR=$PWD/boxes
+DEVCLOUD_BASEBUILD_DIR=$BASEDIR/basebox-build
+echo $DEVCLOUD_BASEBUILD_DIR
+DEVCLOUD_XEN_BASEBUILD_DIR=$BASEDIR/xenbox-build
+DEVCLOUD_BASE_NAME='devcloudbase'
+DEVCLOUD_XEN_BASE_NAME='devcloudbase-xen'
+OS='ubuntu-12.04.1-server-i386'
+
+
+basebox()  {
+        set +x
+            rvm rvmrc trust $DEVCLOUD_BASEBUILD_DIR/
+    case "$1" in
+        build)
+            cd $DEVCLOUD_BASEBUILD_DIR/
+            set -ex
+            vagrant basebox define $DEVCLOUD_BASE_NAME $OS
+            cp definition.rb postinstall.sh preseed.cfg definitions/$DEVCLOUD_BASE_NAME/
+            vagrant basebox build $DEVCLOUD_BASE_NAME -f -a -n -r
+            vagrant basebox export $DEVCLOUD_BASE_NAME -f
+            set +ex
+            cd $DEVCLOUD_XEN_BASEBUILD_DIR
+            set -ex
+            vagrant box add $DEVCLOUD_BASE_NAME $DEVCLOUD_BASEBUILD_DIR/${DEVCLOUD_BASE_NAME}.box -f
+            ;;
+        clean)
+            cd $DEVCLOUD_BASEBUILD_DIR/
+            set -x
+            rm -f iso/*.iso
+            vagrant -f basebox destroy $DEVCLOUD_BASE_NAME #-f
+            vagrant basebox undefine $DEVCLOUD_BASE_NAME
+            #hackery to inherit the proper rvmrc for the hacked vagrant
+                        set +x
+                cd $BAS$DEVCLOUD_XEN_BASEBUILD_DIR
+                set -x
+            vagrant -f box remove $DEVCLOUD_BASE_NAME virtualbox
+            set +x
+            cd $DEVCLOUD_BASEBUILD_DIR
+            set -x
+            rm -f ${DEVCLOUD_BASE_NAME}.box
+            set +x
+            cd $BASEDIR
+            #rvm --force gemset delete vagrant-release-cloudstack
+            ;;
+    esac
+}
+
+xenbox() {
+
+   set +x
+    rvm rvmrc trust $DEVCLOUD_XEN_BASEBUILD_DIR/
+    case "$1" in
+        build)
+            cd $DEVCLOUD_XEN_BASEBUILD_DIR
+
+            #adding it here because it needs to be added into the $VAGRANT_HOME of
+            #the hacked vagrant
+            set -ex
+            vagrant up
+            vagrant halt
+            vagrant package default --output ${DEVCLOUD_XEN_BASE_NAME}.box
+            vagrant box add $DEVCLOUD_XEN_BASE_NAME ${DEVCLOUD_XEN_BASE_NAME}.box -f
+            ;;
+        clean)
+            cd $DEVCLOUD_XEN_BASEBUILD_DIR
+            set -x
+            vagrant -f box remove $DEVCLOUD_XEN_BASE_NAME virtualbox
+            vagrant  destroy -f
+            rm -f ${DEVCLOUD_XEN_BASE_NAME}.box
+            set +x
+            #rvm --force gemset delete vagrant-xen-cloudstack
+            set -x
+            ;;
+    esac
+}
+usage() {
+
+cat <<EOF
+$(basename $0) [-h] [-b] [c] (basebox|xenbox) | all
+Builds / cleans boxes used to build the devcloud box
+
+where:
+    -h  show this help text
+    -b  builds the box(es)
+    -c  cleans the box(es)
+
+EOF
+}
+
+while getopts 'hbc' option; do
+  case "$option" in
+    h) usage
+       exit
+       ;;
+    b) action="build"
+       ;;
+    c) action="clean"
+       ;;
+    ?) printf "illegal option: '%s'\n" "$OPTARG" >&2
+       echo "$usage" >&2
+       exit 1
+       ;;
+  esac
+done
+shift $((OPTIND - 1))
+
+posargs=$@
+
+#removes duplicate positionals
+
+posargs=$(echo "$posargs" | tr ' ' '\n' | nl | sort -u -k2 | sort -n | cut -f2-)
+
+
+
+for arg in $posargs; do
+
+    case "$arg" in
+        basebox)
+            true
+            ;;
+        xenbox)
+            true
+            ;;
+        all)
+            true
+            ;;
+        *)
+            usage
+            exit 1
+            ;;
+    esac
+
+done
+
+cd $BASEDIR
+
+for arg in $posargs; do
+    case "$1" in
+        "all")
+            case "$action" in
+                clean)
+                    xenbox $action
+                    basebox $action
+                    ;;
+                build)
+                    basebox $action
+                    xenbox $action
+                    ;;
+            esac
+            ;;
+        $arg)
+            $arg $action
+            ;;
+        esac
+done

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/.rvmrc
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/.rvmrc b/tools/devcloud/src/deps/boxes/basebox-build/.rvmrc
new file mode 100644
index 0000000..cbeb628
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/basebox-build/.rvmrc
@@ -0,0 +1,7 @@
+rvm use ruby-1.9.3@vagrant-release-cloudstack --create
+export VAGRANT_HOME=$HOME/.vagrant.d-release-cloudstack
+bundle check > /dev/null 2>&1
+RETVAL=$?
+if [ $RETVAL -ne 0 ]; then
+    bundle install
+fi

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/Gemfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/Gemfile b/tools/devcloud/src/deps/boxes/basebox-build/Gemfile
new file mode 100644
index 0000000..1649e85
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/basebox-build/Gemfile
@@ -0,0 +1,3 @@
+source 'https://rubygems.org'
+gem 'veewee', :git => 'https://github.com/jedi4ever/veewee.git'
+gem 'em-winrm'

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/Vagrantfile b/tools/devcloud/src/deps/boxes/basebox-build/Vagrantfile
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/definition.rb
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/definition.rb b/tools/devcloud/src/deps/boxes/basebox-build/definition.rb
new file mode 100644
index 0000000..a7f9071
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/basebox-build/definition.rb
@@ -0,0 +1,60 @@
+# 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.
+
+
+Veewee::Session.declare({
+  :cpu_count => '1',
+  :memory_size=> '2048',
+  :disk_size => '20000',
+  :disk_format => 'VMDK',
+  :hostiocache => 'off',
+  :os_type_id => 'Ubuntu',
+  :iso_file => "ubuntu-12.04.1-server-i386.iso",
+  :iso_src => "http://releases.ubuntu.com/12.04/ubuntu-12.04.1-server-i386.iso",
+  :iso_md5 => '32184a83c8b5e6031e1264e5c499bc03',
+  :iso_download_timeout => "1000",
+  :boot_wait => "4",
+  :virtualbox => {
+    :vm_options => [
+      "ioapic" => "on",
+      "hwvirtex" => "on",
+      "nestedpaging" => "on"
+    ]
+  },
+  :boot_cmd_sequence => [
+    '<Esc><Esc><Enter>',
+    '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
+    'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
+    'hostname=%NAME% ',
+    'fb=false debconf/frontend=noninteractive ',
+    'keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false ',
+    'initrd=/install/initrd.gz -- <Enter>'
+],
+  :kickstart_port => "7122",
+  :kickstart_timeout => "10000",
+  :kickstart_file => "preseed.cfg",
+  :ssh_login_timeout => "10000",
+  :ssh_user => "devcloud",
+  :ssh_password => "devcloud",
+  :ssh_key => "",
+  :ssh_host_port => "2222",
+  :ssh_guest_port => "22",
+  :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
+  :shutdown_cmd => "shutdown -P now",
+  :postinstall_files => [ "postinstall.sh"],
+  :postinstall_timeout => "10000"
+})

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/postinstall.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/postinstall.sh b/tools/devcloud/src/deps/boxes/basebox-build/postinstall.sh
new file mode 100644
index 0000000..217d230
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/basebox-build/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
+echo "root:password" | chpasswd
+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

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg b/tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg
new file mode 100644
index 0000000..00bae61
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/basebox-build/preseed.cfg
@@ -0,0 +1,122 @@
+# 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.
+
+## Options to set on the command line
+d-i debian-installer/locale string en_US.utf8
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layout string USA
+
+#d-i netcfg/get_hostname string dummy
+d-i netcfg/get_hostname string devcloud
+d-i netcfg/get_domain string cloudstack.org
+
+# Continue without a default route
+# Not working , specify a dummy in the DHCP
+#d-i netcfg/no_default_route boolean
+
+d-i time/zone string UTC
+d-i clock-setup/utc-auto boolean true
+d-i clock-setup/utc boolean true
+
+d-i kbd-chooser/method select American English
+
+d-i netcfg/wireless_wep string
+
+d-i base-installer/kernel/override-image string linux-server
+#d-i base-installer/kernel/override-image string linux-image-2.6.32-21-generic
+
+# Choices: Dialog, Readline, Gnome, Kde, Editor, Noninteractive
+d-i debconf debconf/frontend select Noninteractive
+
+d-i pkgsel/install-language-support boolean false
+tasksel tasksel/first multiselect standard, ubuntu-server
+
+#d-i partman-auto/method string regular
+d-i partman-auto/method string lvm
+d-i partman-auto-lvm/no_boot boolean true
+d-i partman-auto/disk string /dev/sda
+d-i partman-auto-lvm/new_vg_name string devcloud
+d-i partman-auto/purge_lvm_from_device boolean true
+d-i partman-basicfilesystems/no_swap boolean false
+
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-auto/choose_recipe select devcloud
+
+d-i partman/confirm_write_new_label boolean true
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman-auto/expert_recipe string \
+devcloud :: \
+4000 4500 4500 ext4 method{ lvm } \
+$lvmok{ } mountpoint{ / } lv_name{ root } \
+format{ } use_filesystem{ } filesystem{ ext4 } \
+.\
+15000 15000 15000 ext4 method{ lvm } \
+$lvmok{ } mountpoint{ /opt } lv_name{ data } \
+format{ } use_filesystem{ } filesystem{ ext4 } \
+.
+
+#http://ubuntu-virginia.ubuntuforums.org/showthread.php?p=9626883
+#Message: "write the changes to disk and configure lvm preseed"
+#http://serverfault.com/questions/189328/ubuntu-kickstart-installation-using-lvm-waits-for-input
+#preseed partman-lvm/confirm_nooverwrite boolean true
+
+# Write the changes to disks and configure LVM?
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select Finish
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/confirm boolean true
+d-i partman-auto-lvm/guided_size string max
+
+## Default user, we can get away with a recipe to change this
+d-i passwd/user-fullname string devcloud
+d-i passwd/username string devcloud
+d-i passwd/user-password password  devcloud
+d-i passwd/user-password-again password devcloud
+d-i user-setup/encrypt-home boolean false
+d-i user-setup/allow-password-weak boolean true
+
+## minimum is puppet and ssh and ntp
+# Individual additional packages to install
+d-i pkgsel/include string openssh-server ntp
+
+# Whether to upgrade packages after debootstrap.
+# Allowed values: none, safe-upgrade, full-upgrade
+d-i pkgsel/upgrade select full-upgrade
+
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i finish-install/reboot_in_progress note
+
+#For the update
+d-i pkgsel/update-policy select none
+
+# debconf-get-selections --install
+#Use mirror
+#d-i apt-setup/use_mirror boolean true
+#d-i mirror/country string manual
+#choose-mirror-bin mirror/protocol string http
+#choose-mirror-bin mirror/http/hostname string 192.168.4.150
+#choose-mirror-bin mirror/http/directory string /ubuntu
+#choose-mirror-bin mirror/suite select maverick
+#d-i debian-installer/allow_unauthenticated string true
+
+choose-mirror-bin mirror/http/proxy string

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/.rvmrc
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/.rvmrc b/tools/devcloud/src/deps/boxes/xenbox-build/.rvmrc
new file mode 100644
index 0000000..fa4f7ad
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/.rvmrc
@@ -0,0 +1,7 @@
+rvm use ruby-1.9.3@vagrant-xen-cloudstack --create
+export VAGRANT_HOME=$HOME/.vagrant.d-xen-cloudstack
+bundle check > /dev/null 2>&1
+RETVAL=$?
+if [ $RETVAL -ne 0 ]; then
+    bundle install
+fi

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/Gemfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/Gemfile b/tools/devcloud/src/deps/boxes/xenbox-build/Gemfile
new file mode 100644
index 0000000..8eab1c7
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'vagrant', :git => 'https://github.com/chipchilders/vagrant'

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/Vagrantfile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/Vagrantfile b/tools/devcloud/src/deps/boxes/xenbox-build/Vagrantfile
new file mode 100644
index 0000000..58e9e64
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/Vagrantfile
@@ -0,0 +1,52 @@
+  # -*- 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"
+  # 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"
+  config.vm.host_name = "devcloud.local"
+
+  # 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.with_ssh = true
+     puppet.manifests_path = File.join 'puppet', 'manifests'
+     puppet.module_path = File.join 'puppet', 'modules', 'devcloudinitial'
+     puppet.manifest_file = 'vagrant-devcloudinitial.pp'
+     puppet.options = ['--trace', '--debug', '--verbose']
+  end
+
+end

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/site.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/site.pp b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/site.pp
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/vagrant-devcloudinitial.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/vagrant-devcloudinitial.pp b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/vagrant-devcloudinitial.pp
new file mode 100644
index 0000000..4f7cfb5
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/manifests/vagrant-devcloudinitial.pp
@@ -0,0 +1 @@
+node default { include devcloudinitial }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/Modulefile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/Modulefile b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/Modulefile
new file mode 100644
index 0000000..b1ca9ad
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/Modulefile
@@ -0,0 +1,8 @@
+name    'puppet-devcloudinitial'
+version '0.0.1'
+source ''
+author 'Apache Software Foundation'
+license 'Licensed under the Apache License, Version 2.0. http://www.apache.org/licenses/LICENSE-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/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/grub
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/grub b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/grub
new file mode 100644
index 0000000..d5de16c
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/grub
@@ -0,0 +1,52 @@
+# 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.
+
+
+# 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/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/interfaces
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/interfaces b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/interfaces
new file mode 100644
index 0000000..0c19720
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/interfaces
@@ -0,0 +1,45 @@
+# 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.
+auto lo
+iface lo inet loopback
+
+auto eth0
+iface eth0 inet manual
+
+allow-hotplug eth1
+iface eth1 inet manual
+
+auto xenbr0
+iface xenbr0 inet dhcp
+        bridge_ports eth0
+        dns_nameservers 8.8.8.8 8.8.4.4
+        post-up route add default gw 10.0.2.2
+
+auto xenbr1
+iface xenbr1 inet static
+        bridge_ports eth1
+        address 192.168.56.10
+        netmask 255.255.255.0
+        network 192.168.56.0
+        broadcast 192.168.56.255
+        gateway 192.168.56.1
+        dns_nameservers 8.8.8.8 8.8.4.4
+        post-up route del default gw 192.168.56.1; route add default gw 192.168.56.1 metric 100;
+
+
+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/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/iptables.save
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/iptables.save b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/iptables.save
new file mode 100644
index 0000000..07647f8
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/iptables.save
@@ -0,0 +1,30 @@
+# 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.
+
+*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
+*filter
+:INPUT ACCEPT [453:27164]
+:FORWARD ACCEPT [0:0]
+:OUTPUT ACCEPT [273:26476]
+COMMIT

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/network.conf
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/network.conf b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/network.conf
new file mode 100644
index 0000000..7096907
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/network.conf
@@ -0,0 +1 @@
+bridge

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xen-defaults
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xen-defaults b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xen-defaults
new file mode 100644
index 0000000..9083968
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xen-defaults
@@ -0,0 +1,18 @@
+# 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.
+
+TOOLSTACK=xapi

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xend
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xend b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xend
new file mode 100644
index 0000000..4a53299
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/files/xend
@@ -0,0 +1,188 @@
+#!/bin/sh
+# 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.
+
+### 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/eddb3dfc/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/manifests/init.pp b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/manifests/init.pp
new file mode 100644
index 0000000..8ceb39c
--- /dev/null
+++ b/tools/devcloud/src/deps/boxes/xenbox-build/puppet/modules/devcloudinitial/manifests/init.pp
@@ -0,0 +1,111 @@
+# 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.
+
+class devcloudinitial {
+
+if $::architecture == 'x86_64'{
+  $debarch='amd64'
+}
+else {
+  $debarch='i386'
+}
+  package {
+    "linux-headers-${::kernelrelease}":
+      ensure => latest;
+    "xen-hypervisor-4.1-${debarch}":
+      ensure  => latest,
+      require => Package["linux-headers-${::kernelrelease}"];
+    'xcp-xapi':
+      ensure  => latest,
+      require => Package["xen-hypervisor-4.1-${debarch}"];
+    'iptables':
+      ensure  => latest;
+    'ebtables':
+      ensure  => latest;
+  }
+
+  file {
+  '/etc/iptables.save':
+      ensure  => 'file',
+      require => Package['iptables'],
+      source  => 'puppet:///modules/devcloudinitial/iptables.save',
+      group   => '0',
+      mode    => '0644',
+      owner   => '0';
+  '/etc/xcp/network.conf':
+      ensure  => 'file',
+      require => Package['xcp-xapi'],
+      source  => 'puppet:///modules/devcloudinitial/network.conf',
+      group   => '0',
+      mode    => '0644',
+      owner   => '0';
+  '/etc/init.d/xend':
+      ensure  => 'file',
+      require => Package['xcp-xapi'],
+      source  => 'puppet:///modules/devcloudinitial/xend',
+      group   => '0',
+      owner   => '0',
+      mode    => '0755';
+  '/etc/default/grub':
+      ensure  => 'file',
+      require => Package["xen-hypervisor-4.1-${debarch}"],
+      source  => 'puppet:///modules/devcloudinitial/grub',
+      group   => '0',
+      mode    => '0644',
+      owner   => '0';
+  '/usr/share/qemu':
+      ensure  => 'directory',
+      require => Package["xen-hypervisor-4.1-${debarch}"],
+      group   => '0',
+      mode    => '0755',
+      owner   => '0';
+  '/usr/share/qemu/keymaps':
+      ensure  => 'link',
+      require => File['/usr/share/qemu'],
+      group   => '0',
+      mode    => '0777',
+      owner   => '0',
+      target  => '/usr/share/qemu-linaro/keymaps';
+  '/etc/network/interfaces':
+      ensure  => 'file',
+      source  => 'puppet:///modules/devcloudinitial/interfaces',
+      group   => '0',
+      mode    => '0644',
+      owner   => '0';
+  '/etc/default/xen':
+      ensure  => 'file',
+      require => Package["xen-hypervisor-4.1-${debarch}"],
+      source  => 'puppet:///modules/devcloudinitial/xen-defaults',
+      group   => '0',
+      mode    => '0644',
+      owner   => '0';
+  }
+
+  service {
+    'xendomains':
+      ensure  => 'stopped',
+      require => Package['xcp-xapi'],
+      enable  => false;
+  }
+
+  exec { '/usr/sbin/update-grub':
+    subscribe   => File['/etc/default/grub'],
+    refreshonly => true,
+    cwd         => '/',
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/manifests/vagrant-devcloud.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/manifests/vagrant-devcloud.pp b/tools/devcloud/src/puppet/manifests/vagrant-devcloud.pp
new file mode 100644
index 0000000..47b07dc
--- /dev/null
+++ b/tools/devcloud/src/puppet/manifests/vagrant-devcloud.pp
@@ -0,0 +1,18 @@
+# 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.
+
+include devcloud

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/Modulefile
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/Modulefile b/tools/devcloud/src/puppet/modules/devcloud/Modulefile
new file mode 100644
index 0000000..ace7d48
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/Modulefile
@@ -0,0 +1,8 @@
+name    'puppet-devcloud'
+version '0.0.1'
+source ''
+author 'Apache Software Foundation'
+license 'Licensed under the Apache License, Version 2.0. http://www.apache.org/licenses/LICENSE-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/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/compare.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/compare.sh b/tools/devcloud/src/puppet/modules/devcloud/files/compare.sh
new file mode 100644
index 0000000..e1667c1
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/compare.sh
@@ -0,0 +1,6 @@
+#! /bin/bash -eux
+
+FILE=$1
+WORKING_DIR=$2
+cd $WORKING_DIR
+test `grep  $FILE ${WORKING_DIR}/md5sum.txt | awk '{print $1}'` == `md5sum $FILE |awk '{print $1}'`
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/configebtables.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/configebtables.sh b/tools/devcloud/src/puppet/modules/devcloud/files/configebtables.sh
new file mode 100644
index 0000000..8329333
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/configebtables.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# 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.
+mac=`/sbin/ifconfig xenbr0 |/bin/grep HWaddr |/usr/bin/awk '{print $5}'`
+/sbin/ebtables -I FORWARD -d ! $mac -i eth0 -p IPV4 --ip-prot udp --ip-dport 67:68 -j DROP
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/configlocalstorage.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/configlocalstorage.sh b/tools/devcloud/src/puppet/modules/devcloud/files/configlocalstorage.sh
new file mode 100644
index 0000000..3ed1a39
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/configlocalstorage.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# 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.
+/usr/bin/xe sr-list | /bin/grep local-storage
+rc=$?
+if [[ $rc != 0 ]] ; then
+    hostuuid=`xe host-list |grep uuid|awk '{print $5}'`;
+    xe sr-create host-uuid=$hostuuid name-label=local-storage shared=false type=file device-config:location=/opt/storage/primary
+fi
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/configvnc.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/configvnc.sh b/tools/devcloud/src/puppet/modules/devcloud/files/configvnc.sh
new file mode 100644
index 0000000..b739dc6
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/configvnc.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# 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.
+
+grep 0.0.0.0 /usr/lib/xcp/lib/vncterm-wrapper
+rc=$?
+if [[ $rc != 0 ]] ; then
+    sed -i 's/VNCTERM_LISTEN=.\+/VNCTERM_LISTEN="-v 0.0.0.0:1"/' /usr/lib/xcp/lib/vncterm-wrapper
+fi
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/exports
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/exports b/tools/devcloud/src/puppet/modules/devcloud/files/exports
new file mode 100644
index 0000000..1f91650
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/exports
@@ -0,0 +1,19 @@
+# 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.
+
+/opt/storage/primary *(rw,no_subtree_check,no_root_squash,fsid=0)
+/opt/storage/secondary *(rw,no_subtree_check,no_root_squash,fsid=0)

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/installmaven.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/installmaven.sh b/tools/devcloud/src/puppet/modules/devcloud/files/installmaven.sh
new file mode 100644
index 0000000..8cd3df0
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/installmaven.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# 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.
+
+cd /opt/cloudstack
+/usr/bin/wget http://apache.mirrors.pair.com/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
+/bin/tar xvfz apache-maven-3.0.4-bin.tar.gz

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/startdevcloud.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/startdevcloud.sh b/tools/devcloud/src/puppet/modules/devcloud/files/startdevcloud.sh
new file mode 100644
index 0000000..27a7a04
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/startdevcloud.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# 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.
+
+export CATALINA_HOME=/opt/cloudstack/apache-tomcat-6.0.32
+cd /opt/cloudstack/incubator-cloudstack/
+nohup ant run > /dev/null 2>&1 &
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/files/updatecode.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/files/updatecode.sh b/tools/devcloud/src/puppet/modules/devcloud/files/updatecode.sh
new file mode 100644
index 0000000..5525920
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/files/updatecode.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# 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.
+
+cd /opt/cloudstack
+git clone https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git
+rc=$?
+if [[ $rc != 0 ]] ; then
+    cd /opt/cloudstack/incubator-cloudstack
+    git pull origin master
+fi
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/lib/facter/xeninfo.rb
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/lib/facter/xeninfo.rb b/tools/devcloud/src/puppet/modules/devcloud/lib/facter/xeninfo.rb
new file mode 100644
index 0000000..b174937
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/lib/facter/xeninfo.rb
@@ -0,0 +1,5 @@
+Facter.add(:xen_hostuuid) do
+  setcode do
+    uuid=Facter::Util::Resolution.exec('xe host-list |grep uuid|awk \'{print $5}\'')
+  end
+end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/manifests/functions/httpdownload.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/manifests/functions/httpdownload.pp b/tools/devcloud/src/puppet/modules/devcloud/manifests/functions/httpdownload.pp
new file mode 100644
index 0000000..5e3db33
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/manifests/functions/httpdownload.pp
@@ -0,0 +1,20 @@
+ define devcloud::functions::httpdownload () {
+  $file="${name['basedir']}/${name['basefile']}"
+
+  exec {
+    "getfileifnotexist${name}":
+      command => "/usr/bin/wget ${name['url']}/${file}  -O ${name['local_dir']}/${file}",
+      timeout => 0,
+      unless  => "test -f ${name['local_dir']}/${file}",
+      require => [ File["${name['local_dir']}/${name['base_dir']}/"],
+                   Exec["get_md5sums"] ];
+
+
+    "getfileifnotmatch${name}":
+      command => "/usr/bin/wget ${name['url']}/${file} -O ${name['local_dir']}/${file}",
+      timeout => 0,
+      unless  => "/usr/local/bin/compare.sh ${file} ${name['working_dir']} ",
+      require => [  Exec["getfileifnotexist${name}"], File["/usr/local/bin/compare.sh"] ]
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/manifests/init.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/manifests/init.pp b/tools/devcloud/src/puppet/modules/devcloud/manifests/init.pp
new file mode 100644
index 0000000..86ef72f
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/manifests/init.pp
@@ -0,0 +1,252 @@
+# 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 permission  s and limitations
+# under the License.
+
+
+
+class devcloud (
+
+  $cs_dir            = $devcloud::params::cs_dir ,
+  $devcloud_path     = $devcloud::params::devcloud_path,
+  $gitrepo           = $devcloud::params::gitrepo,
+  $storage_dir       = $devcloud::params::storage_dir,
+  $tomcat_version    = $devcloud::params::tomcat_version,
+  $tomcat_url        = $devcloud::params::tomcat_url,
+  $tomcat_home       = $devcloud::params::tomcat_home,
+  $maven_version     = $devcloud::params::maven_version,
+  $maven_url         = $devcloud::params::maven_url,
+  $maven_home        = $devcloud::params::maven_home,
+  $downloads         = $devcloud::params::downloads,
+  $md5sum_local      = $devcloud::params::md5sum_local,
+  $md5sum_remote     = $devcloud::params::md5sum_remote,
+  $hostuuid          = $::xen_hostuuid,
+  $bridge_device_mac = $::macaddress_xenbr0,
+  $build_cloudstack  = $devcloud::params::build_cloudstack
+
+) inherits devcloud::params {
+
+
+  Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ] }
+
+  service {
+    'ebtables':
+      ensure  => 'running',
+      enable  => true;
+
+  'nfs-kernel-server':
+    ensure    => 'running',
+    require   => Package['nfs-server'],
+    enable    => true,
+    subscribe => File['/etc/exports'];
+  }
+
+  package
+  { [ 'ant',
+      'git',
+      'python-mysql.connector',
+      'mkisofs',
+      'mysql-server',
+      'nfs-server',
+      'openjdk-6-jdk',
+      'unzip' ]:
+        ensure  => latest,
+  }
+
+  exec {
+
+    'get_md5sums':
+      command => "/usr/bin/wget -N ${md5sum_remote} -O ${md5sum_local}",
+      require => File["${storage_dir}/secondary/template/tmpl/1/"],
+      timeout => '0';
+
+    'getecho':
+      command => "/usr/bin/wget ${devcloud_path}/echo -O /usr/lib/xcp/plugins/echo",
+      creates => '/usr/lib/xcp/plugins/echo';
+
+    'setxcpperms':
+      command => '/bin/chmod -R 755 /usr/lib/xcp',
+      require => Exec['getecho'];
+
+    'get_code':
+      command => "git clone ${gitrepo}",
+      cwd     => $cs_dir,
+      require => File[$cs_dir],
+      timeout => '7200',
+      creates => "${cs_dir}/incubator-cloudstack";
+
+    'update_code':
+      command => 'git pull origin master',
+      cwd     => "${cs_dir}/incubator-cloudstack",
+      timeout => '7200',
+      require => [ Exec['get_code']];
+
+    'configlocal':
+      command => "xe sr-create host-uuid=${hostuuid} name-label=local-storage shared=false type=file device-config:location=${storage_dir}/primary",
+      cwd     => '/',
+      unless  => '/usr/bin/xe sr-list | /bin/egrep \'local-storage|Cloud Stack Local EXT Storage Pool\'',
+      require => [
+        File["${storage_dir}/primary"],
+        ];
+
+    'configvnc':
+      command => 'sed -i \'s/VNCTERM_LISTEN=.\+/VNCTERM_LISTEN="-v 0.0.0.0:1"/\' /usr/lib/xcp/lib/vncterm-wrapper',
+      onlyif  => '/bin/grep "0.0.0.0:1" /usr/lib/xcp/lib/vncterm-wrapper';
+
+    'downloadtomcat':
+      command => "/usr/bin/wget ${tomcat_url} -P ${cs_dir}/",
+      creates => "${cs_dir}/apache-tomcat-${tomcat_version}.zip",
+      require => File[$cs_dir],
+      timeout => '0';
+
+    'unziptomcat':
+      require => [
+        Package['unzip'],
+        Exec['downloadtomcat']
+        ],
+      creates => $tomcat_home,
+      command => "/usr/bin/unzip apache-tomcat-${tomcat_version}.zip",
+      cwd     => $cs_dir,
+      timeout => '0';
+
+    'downloadmaven':
+      command => "/usr/bin/wget ${maven_url} -P ${cs_dir}/",
+      creates => "${cs_dir}/apache-maven-${maven_version}-bin.tar.gz",
+      require => Exec['unziptomcat'],
+      timeout => '0';
+
+    'install_maven':
+      require => Exec['downloadmaven'],
+      creates => $maven_home,
+      command => "/bin/tar xzvf ${cs_dir}/apache-maven-${maven_version}-bin.tar.gz",
+      cwd     => $cs_dir,
+      timeout => '0';
+
+    'tomcatperms':
+      command => "chmod +x ${tomcat_home}/bin/*.sh",
+      require => Exec['unziptomcat'];
+
+    'catalina_home':
+      require => Exec['unziptomcat'],
+      unless  => '/bin/grep CATALINA_HOME /root/.bashrc',
+      command => "/bin/echo \"export CATALINA_HOME=${tomcat_home}\" >> /root/.bashrc",
+      cwd     => '/';
+
+    'configebtables':
+      require     => Service['ebtables'],
+      command     => "/sbin/ebtables -I FORWARD -d ! ${bridge_device_mac} -i eth1 -p IPV4 --ip-prot udp --ip-dport 67:68 -j DROP",
+      unless      => "/sbin/ebtables -L | grep \"-I FORWARD -d ! ${bridge_device_mac} -i eth1 -p IPV4 --ip-prot udp --ip-dport 67:68 -j DROP\"",
+      refreshonly => true,
+      cwd         => '/',
+      path        => '/sbin/:/usr/bin/:/bin'
+}
+
+  if $build_cloudstack {
+
+    exec {
+      'build_cloudstack':
+        require  => [
+          Package['ant','mkisofs'],
+          Exec['install_maven'],
+          File[
+            "${cs_dir}/incubator-cloudstack/dist",
+            "${cs_dir}/incubator-cloudstack/target",
+            "${cs_dir}/buildcloudstack.sh"]
+          ],
+        command  => "${cs_dir}/buildcloudstack.sh",
+        cwd      => $cs_dir,
+        timeout  => '0';
+    }
+  }
+
+
+  file {
+
+    [ $cs_dir,
+      $storage_dir,
+      "${storage_dir}/primary",
+      "${storage_dir}/secondary",
+      "${storage_dir}/secondary/template",
+      "${storage_dir}/secondary/template/tmpl",
+      "${storage_dir}/secondary/template/tmpl/1",
+      "${storage_dir}/secondary/template/tmpl/1/1",
+      "${storage_dir}/secondary/template/tmpl/1/5" ]:
+        ensure => 'directory',
+        group  => '0',
+        mode   => '0755',
+        owner  => '0';
+
+    [ "${cs_dir}/incubator-cloudstack/dist",
+      "${cs_dir}/incubator-cloudstack/target" ] :
+      ensure  => 'directory',
+      group   => '0',
+      mode    => '0755',
+      owner   => '0',
+      require => [ Exec['update_code']];
+
+    "${cs_dir}/buildcloudstack.sh":
+      ensure  => 'file',
+      mode    => '0755',
+      owner   => '0',
+      group   => '0',
+      content => template('devcloud/buildcloudstack.sh.erb');
+
+    "${cs_dir}/startcloudstack.sh":
+      ensure  => 'file',
+      mode    => '0755',
+      owner   => '0',
+      group   => '0',
+      content => template('devcloud/startcloudstack.sh.erb');
+
+    '/root/.ssh' :
+      ensure => 'directory',
+      group  => 'root',
+      mode   => '0700',
+      owner  => 'root';
+
+    "${cs_dir}/startdevcloud.sh":
+      ensure  => 'file',
+      source  => 'puppet:///modules/devcloud/startdevcloud.sh',
+      mode    => '0755',
+      owner   => '0',
+      group   => '0';
+
+    '/usr/local/bin/compare.sh':
+      ensure  => 'file',
+      source  => 'puppet:///modules/devcloud/compare.sh',
+      mode    => '0755',
+      owner   => 'root',
+      group   => 'root';
+
+    '/etc/exports':
+      ensure  => 'file',
+      require => Package['nfs-server'],
+      source  => 'puppet:///modules/devcloud/exports',
+      mode    => '0644',
+      owner   => '0',
+      group   => '0';
+
+    }
+
+
+  devcloud::functions::httpdownload{
+    $downloads:
+      require =>
+        [ File["${storage_dir}/secondary/template/tmpl/1/1"],
+          File["${storage_dir}/secondary/template/tmpl/1/5"],
+          Exec['get_md5sums'] ]
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/manifests/params.pp
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/manifests/params.pp b/tools/devcloud/src/puppet/modules/devcloud/manifests/params.pp
new file mode 100644
index 0000000..836263a
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/manifests/params.pp
@@ -0,0 +1,61 @@
+# == Class: devcloud::params
+#
+# This class implements the module params pattern, but it's loaded using hiera
+# as opposed to the 'default' usage of coding the parameter values in your
+# manifest.
+#
+# == Usage
+#
+# Don't use this class directly; it's being used where it is needed
+#
+class devcloud::params {
+
+      $cs_dir         = '/opt/cloudstack'
+      $storage_dir    = '/opt/storage'
+      $tomcat_version = '6.0.32'
+      $tomcat_url     = "http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat_version}/bin/apache-tomcat-${tomcat_version}.zip"
+      $tomcat_home    = "${cs_dir}/apache-tomcat-${tomcat_version}"
+      $maven_version  = '3.0.4'
+      $maven_url      = "http://apache.mirrors.pair.com/maven/maven-3/${maven_version}/binaries/apache-maven-${maven_version}-bin.tar.gz"
+      $maven_home     = "${cs_dir}/apache-maven-${maven_version}"
+      $devcloud_path  = 'http://download.cloud.com/templates/devcloud'
+      $template_path  = "${devcloud_path}/defaulttemplates"
+      $md5sum_remote  = "${template_path}/md5sum.txt"
+      $md5sum_local   = "${storage_dir}/secondary/template/tmpl/1/md5sum.txt"
+      $template_dir   = "${storage_dir}/secondary/template/tmpl/1"
+      $gitrepo        = 'https://github.com/apache/incubator-cloudstack.git'
+      $build_cloudstack = false
+
+
+  $downloads =  [
+
+    {
+      'basefile'    => 'template.properties',
+      'basedir'     => '1',
+      'url'         => $template_path,
+      'local_dir'   => $template_dir,
+      'working_dir' => $template_dir
+    },
+    {
+      'basefile'    => 'template.properties',
+      'basedir'     => '5',
+      'url'         => $template_path,
+      'local_dir'   => $template_dir,
+      'working_dir' => $template_dir
+    },
+    {
+      'basefile'    => 'dc68eb4c-228c-4a78-84fa-b80ae178fbfd.vhd',
+      'basedir'     => '1',
+      'url'         => $template_path,
+      'local_dir'   => $template_dir,
+      'working_dir' => $template_dir
+    },
+    {
+      'basefile'    => 'ce5b212e-215a-3461-94fb-814a635b2215.vhd',
+      'basedir'     => '5',
+      'url'         => $template_path,
+      'local_dir'   => $template_dir,
+      'working_dir' => $template_dir
+    }
+  ]
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/templates/buildcloudstack.sh.erb
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/templates/buildcloudstack.sh.erb b/tools/devcloud/src/puppet/modules/devcloud/templates/buildcloudstack.sh.erb
new file mode 100644
index 0000000..acf9b0b
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/templates/buildcloudstack.sh.erb
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# 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.
+
+export CATALINA_HOME=<%= @tomcat_home %>
+export M2_HOME=<%= @maven_home %>
+export M2=$M2_HOME/bin
+MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=800m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+PATH=$M2:$PATH
+cd <%= @cs_dir %>/incubator-cloudstack/
+<%= @maven_home %>/bin/mvn clean install -P developer,systemvm
+<%= @maven_home %>/bin/mvn -pl developer,tools/devcloud -Ddeploydb -P developer
+<%= @maven_home %>/bin/mvn -P developer -pl tools/devcloud -Ddeploysvr

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/puppet/modules/devcloud/templates/startcloudstack.sh.erb
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/puppet/modules/devcloud/templates/startcloudstack.sh.erb b/tools/devcloud/src/puppet/modules/devcloud/templates/startcloudstack.sh.erb
new file mode 100644
index 0000000..4a07711
--- /dev/null
+++ b/tools/devcloud/src/puppet/modules/devcloud/templates/startcloudstack.sh.erb
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# 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.
+
+export CATALINA_HOME=<%= @tomcat_home %>
+export M2_HOME=<%= @maven_home %>
+export M2=$M2_HOME/bin
+MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=800m -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+PATH=$M2:$PATH
+cd <%= @cs_dir %>/incubator-cloudstack/
+<%= @maven_home %>/bin/mvn -pl client jetty:run &

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/src/waitforxe.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/src/waitforxe.sh b/tools/devcloud/src/waitforxe.sh
new file mode 100755
index 0000000..d59518f
--- /dev/null
+++ b/tools/devcloud/src/waitforxe.sh
@@ -0,0 +1,23 @@
+#! /bin/bash
+date
+interval=20
+timeout=300
+command="xe host-list"
+
+count=0
+maxcount=$(($timeout/$interval))
+
+
+until  [ $count -gt $maxcount ]; do
+    if $command > /dev/null 2>&1; then
+        echo "\"$command\" executed successfully."
+        date
+        exit 0
+    fi
+    let count=count+1
+    echo "Waiting for \"$command\" to run successfully."
+    sleep $interval
+done
+
+echo "\"$command\" failed to complete."
+date

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/eddb3dfc/tools/devcloud/waitforxe.sh
----------------------------------------------------------------------
diff --git a/tools/devcloud/waitforxe.sh b/tools/devcloud/waitforxe.sh
deleted file mode 100755
index d59518f..0000000
--- a/tools/devcloud/waitforxe.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#! /bin/bash
-date
-interval=20
-timeout=300
-command="xe host-list"
-
-count=0
-maxcount=$(($timeout/$interval))
-
-
-until  [ $count -gt $maxcount ]; do
-    if $command > /dev/null 2>&1; then
-        echo "\"$command\" executed successfully."
-        date
-        exit 0
-    fi
-    let count=count+1
-    echo "Waiting for \"$command\" to run successfully."
-    sleep $interval
-done
-
-echo "\"$command\" failed to complete."
-date