-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathVagrantfile
51 lines (47 loc) · 1.43 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
cluster = {
:controller => {
:hostname => "controller",
:ipaddress => "10.10.10.3",
:type => "controller"
},
:server1 => {
:hostname => "server1",
:ipaddress => "10.10.10.4",
:type => "node"
},
:server2 => {
:hostname => "server2",
:ipaddress => "10.10.10.5",
:type => "node"
},
}
## vagrant plugin install vagrant-hostmanager
## vagrant plugin install vagrant-cachier
## vagrant up
Vagrant.configure("2") do |global_config|
cluster.each_pair do |name, options|
global_config.vm.define name do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "#{name}"
config.vm.network :private_network, ip: options[:ipaddress]
if Vagrant.has_plugin?("vagrant-hostmanager")
config.vm.provision :hosts, :sync_hosts => true
end
config.vm.provider :virtualbox do |v|
v.memory = 1024
if options[:type] == "node"
v.cpus = 2
end
end
if options[:type] == "controller"
config.vm.provision "shell", path: "scripts/controller.sh"
elsif options[:type] == "node"
config.vm.provision "shell", path: "scripts/node.sh"
# config.vm.provision "shell", path: "scripts/openfoam.sh"
end
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
end
end
end