From 434234a9c508284a42afe52d9787bf629774f631 Mon Sep 17 00:00:00 2001 From: Patrick Laurin Date: Fri, 27 Mar 2015 10:11:53 -0400 Subject: [PATCH] Use Fedora vs CentOS for tools VM, add Ubuntu cfg script Change-Id: If730d42fb2f798f94ad4df5ce1bf848277b3da70 Signed-off-by: Patrick Laurin --- test/tools/VM_Tool/README.md | 12 ++--- test/tools/VM_Tool/Vagrantfile | 51 +++++++++++-------- .../VM_Tool/scripts/{centos.sh => fedora.sh} | 12 ++--- test/tools/VM_Tool/scripts/ubuntu.sh | 21 ++++++-- 4 files changed, 59 insertions(+), 37 deletions(-) rename test/tools/VM_Tool/scripts/{centos.sh => fedora.sh} (52%) diff --git a/test/tools/VM_Tool/README.md b/test/tools/VM_Tool/README.md index 1d3e7965f2..edcf71e717 100644 --- a/test/tools/VM_Tool/README.md +++ b/test/tools/VM_Tool/README.md @@ -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 ``` -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 ``` -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 diff --git a/test/tools/VM_Tool/Vagrantfile b/test/tools/VM_Tool/Vagrantfile index 0899a00333..b81a28e5c6 100644 --- a/test/tools/VM_Tool/Vagrantfile +++ b/test/tools/VM_Tool/Vagrantfile @@ -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 diff --git a/test/tools/VM_Tool/scripts/centos.sh b/test/tools/VM_Tool/scripts/fedora.sh similarity index 52% rename from test/tools/VM_Tool/scripts/centos.sh rename to test/tools/VM_Tool/scripts/fedora.sh index 02cdb07ac9..ec40d5b38c 100644 --- a/test/tools/VM_Tool/scripts/centos.sh +++ b/test/tools/VM_Tool/scripts/fedora.sh @@ -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 diff --git a/test/tools/VM_Tool/scripts/ubuntu.sh b/test/tools/VM_Tool/scripts/ubuntu.sh index 370e66caad..625c8790dd 100644 --- a/test/tools/VM_Tool/scripts/ubuntu.sh +++ b/test/tools/VM_Tool/scripts/ubuntu.sh @@ -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 -- 2.36.6