-
Notifications
You must be signed in to change notification settings - Fork 21
/
Vagrantfile
58 lines (51 loc) · 1.83 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- ruby -*-
if ENV['ENV'] == 'dev'
development = true
end
if development
# Define custom error with non-translated message
class EngineBlockError < Vagrant::Errors::VagrantError
def initialize(dir);
@dir = dir
super()
end
def error_message; "Directory " + @dir + " must exist before being able to mount OpenConext-engineblock" end
end
# Check if required directory exists
_engineblock_dir = File.dirname(__FILE__) + "/../OpenConext-engineblock"
unless Dir.exists?(_engineblock_dir)
raise EngineBlockError.new(_engineblock_dir)
end
end
Vagrant.configure("2") do |config|
config.vm.box = "OpenConext-CentOS-7.0"
config.vm.box_url = "https://build.openconext.org/vagrant_boxes/openconext.json"
config.vm.define "lb_centos7" do |lb_centos7|
lb_centos7.vm.network :private_network, ip: "192.168.66.98"
lb_centos7.vm.hostname = "lb.vm.openconext.org"
lb_centos7.vm.provider :virtualbox do |vb|
vb.name = "OpenConext Engineblock Loadbalancer"
vb.customize ["modifyvm", :id, "--memory", "512"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
end
end
config.vm.define "apps_centos7", primary: true do |apps_centos7|
apps_centos7.vm.network :private_network, ip: "192.168.66.99"
apps_centos7.vm.hostname = "apps.vm.openconext.org"
apps_centos7.vm.provider :virtualbox do |vb|
vb.name = "OpenConext Engineblock Apps"
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
end
if development
apps_centos7.vm.synced_folder "../OpenConext-engineblock", "/opt/openconext/OpenConext-engineblock",
type: "nfs",
nfs_version: 4,
nfs_udp: false
apps_centos7.vm.synced_folder ".", "/vagrant",
type: "nfs",
nfs_version: 4,
nfs_udp: false
end
end
end