Update Neon SR3 repo links
[integration/packaging.git] / tutorials / cluster-nodes / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 ##############################################################################
5 # Copyright (c) 2017 Alexis de TalhouĆ«t.  All rights reserved.
6 #
7 # This program and the accompanying materials are made available under the
8 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
9 # and is available at http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11
12 # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
13 VAGRANTFILE_API_VERSION = "2"
14
15 $install_odl = <<SCRIPT
16 HOME=/home/vagrant/
17 mkdir opendaylight
18 cp -r /vagrant/opendaylight/* opendaylight/
19 nohup /vagrant/scripts/setup_odl.sh > setup_odl.log 2>&1 &
20 SCRIPT
21
22 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
23
24   num_nodes = (ENV['NUM_OF_NODES'] || 1).to_i
25
26   config.vm.box = "trusty-server-cloudimg-amd64"
27   config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
28
29   num_nodes.times do |n|
30      config.vm.define "odl-#{n+1}" do | node |
31         node.vm.host_name = "odl-#{n+1}"
32         node.vm.network "private_network", :adapter=>2, ip: "192.168.50.15#{n+1}", bridge: "en0: Wi-Fi (AirPort)"
33         node.vm.provider :virtualbox do |v|
34           v.customize ["modifyvm", :id, "--memory", 4096]
35           v.customize ["modifyvm", :id, "--cpus", 4]
36         end
37         node.vm.provision "install_odl", type: "shell", inline: $install_odl
38       end
39   end
40 end