Use Fedora vs CentOS for tools VM, add Ubuntu cfg script
authorPatrick Laurin <plaurin@inocybe.com>
Fri, 27 Mar 2015 14:11:53 +0000 (10:11 -0400)
committerDaniel Farrell <dfarrell@redhat.com>
Fri, 27 Mar 2015 16:16:53 +0000 (16:16 +0000)
Change-Id: If730d42fb2f798f94ad4df5ce1bf848277b3da70
Signed-off-by: Patrick Laurin <plaurin@inocybe.com>
test/tools/VM_Tool/README.md
test/tools/VM_Tool/Vagrantfile
test/tools/VM_Tool/scripts/fedora.sh [moved from test/tools/VM_Tool/scripts/centos.sh with 52% similarity]
test/tools/VM_Tool/scripts/ubuntu.sh

index 1d3e7965f2eef0655c19df48e9cc94b6a9faeab2..edcf71e717b3d7ebe9f1c33088809aa8739e8c73 100644 (file)
@@ -69,7 +69,7 @@ Use `vagrant status` to see the supported boxes and their current status.
 $ vagrant status
 Current machine states:
 
-centos                    not created (virtualbox)
+fedora                    not created (virtualbox)
 ubuntu                    not created (virtualbox)
 ```
 
@@ -81,10 +81,10 @@ To start a tools VM:
 $ vagrant up <name of box>
 ```
 
-For example, to start the CentOS tools VM:
+For example, to start the Fedora tools VM:
 
 ```ShellSession
-$ vagrant up centos
+$ vagrant up fedora
 ```
 
 #### Connecting to boxes
@@ -95,11 +95,11 @@ To get a shell on a tools VM:
 $ vagrant ssh <name of box>
 ```
 
-For example, to connect to the CentOS tools VM:
+For example, to connect to the Fedora tools VM:
 
 ```ShellSession
-$ vagrant ssh centos
-[vagrant@tools-centos ~]$
+$ vagrant ssh fedora
+[vagrant@tools-fedora ~]$
 ```
 
 #### Cleaning up boxes
index 0899a00333525f78bfecdf62449078c4dd413570..b81a28e5c62a4b3ae669054522c709ebe589edb1 100644 (file)
@@ -8,9 +8,14 @@ $CPU = "2"
 # Initial Vagrant configuration
 Vagrant.configure(2) do |config|
 
-  # --------------------------------
-  # Shared VirtualBox configuration
-  # --------------------------------
+  # ---------------------
+  # Shared configurations
+  # ---------------------
+
+  # Enables SSH X11 forwarding
+  config.ssh.forward_x11 = "true"
+
+  # VirtualBox configuration
   config.vm.provider "virtualbox" do |vb|
     # Set RAM in MB
     vb.memory = $MEMORY
@@ -18,49 +23,51 @@ Vagrant.configure(2) do |config|
     vb.cpus = $CPU
   end
 
-  # --------------------------
-  # Configuration for CentOS 7
-  # --------------------------
-  config.vm.define "centos" do |centos|
-    # Build Vagrant box based on CentOS 7
-    centos.vm.box = "chef/centos-7.0"
+  # ---------------------------
+  # Configuration for Fedora 20
+  # ---------------------------
+
+  # Multi-machine definition for Fedora
+  config.vm.define "fedora" do |fedora|
+    # Build Vagrant box based on Fedora 20
+    fedora.vm.box = "chef/fedora-20"
     # Set hostname of box
-    centos.vm.hostname = "tools-centos"
-    # Enable X11 SSH forwarding for GUI applications
-    config.ssh.forward_x11 = "true"
+    fedora.vm.hostname = "tools-fedora"
+    # Use PTY for provisionning
+    fedora.ssh.pty = "True"
     # Use shell provisioner to install additional packages
-    centos.vm.provision "shell", path: "scripts/centos.sh"
+    fedora.vm.provision "shell", path: "scripts/fedora.sh"
 
     # Install OpenDaylight using its Puppet module
-    centos.vm.provision "puppet" do |puppet|
+    fedora.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
-      vb.name = "Integration Tools: CentOS-7"
+    fedora.vm.provider "virtualbox" do |vb|
+      # Name for guest machine
+      vb.name = "Integration Tools: Fedora 20"
     end
   end
 
   # ----------------------------------
   # Configuration for Ubuntu 14.04 LTS
   # ----------------------------------
+
+  # Multi-machine definition for Ubuntu
   config.vm.define "ubuntu" do |ubuntu|
     # Build Vagrant box based on Ubuntu 14.04
     ubuntu.vm.box = "ubuntu/trusty64"
     # Set hostname of box
     ubuntu.vm.hostname = "tools-ubuntu"
-    # Enable X11 SSH forwarding for GUI applications
-    ubuntu.ssh.forward_x11 = "true"
     # Use shell provisioner to install additional packages
-    #ubuntu.vm.provision "shell", path: "scripts/ubuntu.sh"
+    ubuntu.vm.provision "shell", path: "scripts/ubuntu.sh"
 
     # VirtualBox configuration specific to this box
     ubuntu.vm.provider "virtualbox" do |vb|
-      # Name of VirtualBox guest machine
-      vb.name = "Integration Tools: Ubuntu-14.04"
+      # Name for guest machine
+      vb.name = "Integration Tools: Ubuntu 14.04"
     end
   end
 end
similarity index 52%
rename from test/tools/VM_Tool/scripts/centos.sh
rename to test/tools/VM_Tool/scripts/fedora.sh
index 02cdb07ac989d5f10f3f099a5cd03dcea82a7316..ec40d5b38cdd7cd11c8f7a78b073dabf6c49f82d 100644 (file)
@@ -1,5 +1,8 @@
-# External shell script for the vagrant shell provisioner
-# This applies for the CentOS VM
+#!/usr/bin/env bash
+
+# --------------------------------------------
+# External shell provisioner script for Fedora
+# --------------------------------------------
 
 # Add EPEL repo for access to Puppet, git-review, etc.
 sudo yum install -y epel-release
@@ -7,7 +10,4 @@ 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
+  git
index 370e66caadf0ac83dcaca797205636c7b7d76e10..625c8790dd805a791756bc096a8cec379621dfb1 100644 (file)
@@ -1,4 +1,19 @@
-# External shell script for the vagrant shell provisioner
-# This applies for the Ubuntu VM
+#!/usr/bin/env bash
 
-#TODO
+# --------------------------------------------
+# External shell provisioner script for Ubuntu
+# --------------------------------------------
+
+# Install initial softwares:
+apt-get update
+apt-get install -y \
+  openjdk-7-jre \
+  openjdk-7-jdk \
+  git
+
+# Install Maven
+wget -nv http://apache.sunsite.ualberta.ca/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.tar.gz
+mkdir -p /usr/local/apache-maven
+tar -C /usr/local/apache-maven/ -xzf apache-maven-3.3.1-bin.tar.gz
+echo "export PATH=$PATH:/usr/local/apache-maven/apache-maven-3.3.1/bin" >> /home/vagrant/.bash_profile
+echo "MAVEN_OPTS=\"-Xms256m -Xmx512m\"" >> /home/vagrant/.bash_profile