Merge "Install ODL in tools VM using Puppet provisioner"
authorLuis Gomez <ecelgp@gmail.com>
Wed, 25 Mar 2015 02:23:18 +0000 (02:23 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 25 Mar 2015 02:23:18 +0000 (02:23 +0000)
test/tools/VM_Tool/.gitignore [new file with mode: 0644]
test/tools/VM_Tool/Gemfile [new file with mode: 0644]
test/tools/VM_Tool/Puppetfile [new file with mode: 0644]
test/tools/VM_Tool/Vagrantfile
test/tools/VM_Tool/manifests/odl_install.pp [new file with mode: 0644]

diff --git a/test/tools/VM_Tool/.gitignore b/test/tools/VM_Tool/.gitignore
new file mode 100644 (file)
index 0000000..488329d
--- /dev/null
@@ -0,0 +1,5 @@
+.tmp/
+modules/
+.librarian
+Puppetfile.lock
+Gemfile.lock
diff --git a/test/tools/VM_Tool/Gemfile b/test/tools/VM_Tool/Gemfile
new file mode 100644 (file)
index 0000000..d4b6047
--- /dev/null
@@ -0,0 +1,4 @@
+source "https://rubygems.org"
+
+gem 'puppet'
+gem 'librarian-puppet'
diff --git a/test/tools/VM_Tool/Puppetfile b/test/tools/VM_Tool/Puppetfile
new file mode 100644 (file)
index 0000000..d25f051
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env ruby
+
+forge "https://forgeapi.puppetlabs.com"
+
+mod 'dfarrell07-opendaylight',
+  :git => 'git://github.com/dfarrell07/puppet-opendaylight.git',
+  :ref => 'origin/master'
index 10c212ef30523cf4bbb349b4f5923d1e3926d15c..414eb2be9b9d0d7387ad426613c56aac7f8f3d62 100644 (file)
@@ -5,40 +5,30 @@
 $MEMORY = "2048"
 $CPU = "2"
 
-# Opendaylight release version and distribution name
-$ODL_RELEASE = "0.2.3-Helium-SR3"
-$ODL_DIST = "distribution-karaf" + "-" + $ODL_RELEASE
-
 # Inline shell script for provisioning CentOS 7
 $centos_script = <<SCRIPT
-#sudo yum update
+# Add EPEL repo for access to Puppet, git-review, etc.
+sudo yum install -y epel-release
 
+# Install other packages (must be done after EPEL repo add)
 sudo yum install -y \
+  puppet \
   git \
   git-review \
   vim \
-  nano \
-  java-1.7.0-openjdk
-
-wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/$1/$2.tar.gz
-
-tar -xzvf $2.tar.gz
-
-sudo chown -R vagrant:vagrant $2
-
-rm $2.tar.gz
+  nano
 SCRIPT
 
-# Initial vagrant configuration
+# Initial Vagrant configuration
 Vagrant.configure(2) do |config|
 
   # --------------------------------
-  # Initial virtualbox configuration
+  # Shared VirtualBox configuration
   # --------------------------------
   config.vm.provider "virtualbox" do |vb|
-    # Set memory value here
+    # Set RAM in MB
     vb.memory = $MEMORY
-    # Set number of CPU cores here
+    # Set num CPU cores
     vb.cpus = $CPU
   end
 
@@ -46,22 +36,28 @@ Vagrant.configure(2) do |config|
   # Configuration for CentOS 7
   # --------------------------
   config.vm.define "centos" do |centos|
-    # Build vagrant box based on CentOS 7
+    # Build Vagrant box based on CentOS 7
     centos.vm.box = "chef/centos-7.0"
-    # Hostname of virtual machine
+    # Set hostname of box
     centos.vm.hostname = "tools-centos"
-    # X11 ssh forwarding
+    # Enable X11 SSH forwarding for GUI applications
     config.ssh.forward_x11 = "true"
-    # Provision VM
+
+    # Use shell provisioner to install additional packages
     centos.vm.provision "shell" do |shell|
-      # Inline shell provisionning
+      # Inline shell provisioning
       shell.inline = $centos_script
-      # Pass arguments to shell provisionning
-      shell.args = [$ODL_RELEASE, $ODL_DIST].join(" ")
     end
-    # Specific virtualbox guest configuration
+
+    # Install OpenDaylight using its Puppet module
+    centos.vm.provision "puppet" do |puppet|
+      puppet.module_path = ["modules"]
+      puppet.manifest_file = "odl_install.pp"
+    end
+
+    # VirtualBox configuration specific to this box
     centos.vm.provider "virtualbox" do |vb|
-      # Name of virtualbox guest machine
+      # Name of VirtualBox guest machine
       vb.name = "Integration Tools: CentOS-7"
     end
   end
@@ -70,15 +66,15 @@ Vagrant.configure(2) do |config|
   # Configuration for Ubuntu 14.04 LTS
   # ----------------------------------
   config.vm.define "ubuntu" do |ubuntu|
-    # Build vagrant box based on Ubuntu 14.04
+    # Build Vagrant box based on Ubuntu 14.04
     ubuntu.vm.box = "ubuntu/trusty64"
-    # Hostname of virtual machine
+    # Set hostname of box
     ubuntu.vm.hostname = "tools-ubuntu"
-    # X11 ssh forwarding
+    # Enable X11 SSH forwarding for GUI applications
     config.ssh.forward_x11 = "true"
-    # Specific virtualbox guest configuration
+    # VirtualBox configuration specific to this box
     ubuntu.vm.provider "virtualbox" do |vb|
-      # Name of virtualbox guest machine
+      # Name of VirtualBox guest machine
       vb.name = "Integration Tools: Ubuntu-14.04"
     end
   end
diff --git a/test/tools/VM_Tool/manifests/odl_install.pp b/test/tools/VM_Tool/manifests/odl_install.pp
new file mode 100644 (file)
index 0000000..6cdcf3e
--- /dev/null
@@ -0,0 +1,3 @@
+class { 'opendaylight':
+  install_method => 'rpm',
+}