Merge "Install ODL in tools VM using Puppet provisioner"
[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 # Inline shell script for provisioning CentOS 7
9 $centos_script = <<SCRIPT
10 # Add EPEL repo for access to Puppet, git-review, etc.
11 sudo yum install -y epel-release
12
13 # Install other packages (must be done after EPEL repo add)
14 sudo yum install -y \
15   puppet \
16   git \
17   git-review \
18   vim \
19   nano
20 SCRIPT
21
22 # Initial Vagrant configuration
23 Vagrant.configure(2) do |config|
24
25   # --------------------------------
26   # Shared VirtualBox configuration
27   # --------------------------------
28   config.vm.provider "virtualbox" do |vb|
29     # Set RAM in MB
30     vb.memory = $MEMORY
31     # Set num CPU cores
32     vb.cpus = $CPU
33   end
34
35   # --------------------------
36   # Configuration for CentOS 7
37   # --------------------------
38   config.vm.define "centos" do |centos|
39     # Build Vagrant box based on CentOS 7
40     centos.vm.box = "chef/centos-7.0"
41     # Set hostname of box
42     centos.vm.hostname = "tools-centos"
43     # Enable X11 SSH forwarding for GUI applications
44     config.ssh.forward_x11 = "true"
45
46     # Use shell provisioner to install additional packages
47     centos.vm.provision "shell" do |shell|
48       # Inline shell provisioning
49       shell.inline = $centos_script
50     end
51
52     # Install OpenDaylight using its Puppet module
53     centos.vm.provision "puppet" do |puppet|
54       puppet.module_path = ["modules"]
55       puppet.manifest_file = "odl_install.pp"
56     end
57
58     # VirtualBox configuration specific to this box
59     centos.vm.provider "virtualbox" do |vb|
60       # Name of VirtualBox guest machine
61       vb.name = "Integration Tools: CentOS-7"
62     end
63   end
64
65   # ----------------------------------
66   # Configuration for Ubuntu 14.04 LTS
67   # ----------------------------------
68   config.vm.define "ubuntu" do |ubuntu|
69     # Build Vagrant box based on Ubuntu 14.04
70     ubuntu.vm.box = "ubuntu/trusty64"
71     # Set hostname of box
72     ubuntu.vm.hostname = "tools-ubuntu"
73     # Enable X11 SSH forwarding for GUI applications
74     config.ssh.forward_x11 = "true"
75     # VirtualBox configuration specific to this box
76     ubuntu.vm.provider "virtualbox" do |vb|
77       # Name of VirtualBox guest machine
78       vb.name = "Integration Tools: Ubuntu-14.04"
79     end
80   end
81 end