Removed a space from between library HTTP GET parameters.
[integration/test.git] / test / tools / VM_Tool / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 # Set memory value (MB) and number of CPU cores here
5 $MEMORY = "2048"
6 $CPU = "2"
7
8 # Opendaylight release version and distribution name
9 $ODL_RELEASE = "0.2.3-Helium-SR3"
10 $ODL_DIST = "distribution-karaf" + "-" + $ODL_RELEASE
11
12 # Inline shell script for provisioning CentOS 7
13 $centos_script = <<SCRIPT
14 #sudo yum update
15
16 sudo yum install -y \
17   git \
18   git-review \
19   vim \
20   nano \
21   java-1.7.0-openjdk
22
23 wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/$1/$2.tar.gz
24
25 tar -xzvf $2.tar.gz
26
27 sudo chown -R vagrant:vagrant $2
28
29 rm $2.tar.gz
30 SCRIPT
31
32 # Initial vagrant configuration
33 Vagrant.configure(2) do |config|
34
35   # --------------------------------
36   # Initial virtualbox configuration
37   # --------------------------------
38   config.vm.provider "virtualbox" do |vb|
39     # Set memory value here
40     vb.memory = $MEMORY
41     # Set number of CPU cores here
42     vb.cpus = $CPU
43   end
44
45   # --------------------------
46   # Configuration for CentOS 7
47   # --------------------------
48   config.vm.define "centos" do |centos|
49     # Build vagrant box based on CentOS 7
50     centos.vm.box = "chef/centos-7.0"
51     # Hostname of virtual machine
52     centos.vm.hostname = "tools-centos"
53     # X11 ssh forwarding
54     config.ssh.forward_x11 = "true"
55     # Provision VM
56     centos.vm.provision "shell" do |shell|
57       # Inline shell provisionning
58       shell.inline = $centos_script
59       # Pass arguments to shell provisionning
60       shell.args = [$ODL_RELEASE, $ODL_DIST].join(" ")
61     end
62     # Specific virtualbox guest configuration
63     centos.vm.provider "virtualbox" do |vb|
64       # Name of virtualbox guest machine
65       vb.name = "Integration Tools: CentOS-7"
66     end
67   end
68
69   # ----------------------------------
70   # Configuration for Ubuntu 14.04 LTS
71   # ----------------------------------
72   config.vm.define "ubuntu" do |ubuntu|
73     # Build vagrant box based on Ubuntu 14.04
74     ubuntu.vm.box = "ubuntu/trusty64"
75     # Hostname of virtual machine
76     ubuntu.vm.hostname = "tools-ubuntu"
77     # X11 ssh forwarding
78     config.ssh.forward_x11 = "true"
79     # Specific virtualbox guest configuration
80     ubuntu.vm.provider "virtualbox" do |vb|
81       # Name of virtualbox guest machine
82       vb.name = "Integration Tools: Ubuntu-14.04"
83     end
84   end
85 end