-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
81 lines (70 loc) · 2.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
# For a complete reference, please see the online documentation at
# https://www.vagrantup.com/docs
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = {
'master' => {
:ip => '10.0.11.11',
:memory => 512,
:ports => [],
:bootstrap => true,
:synced_folders => false
},
'data' => {
:ip => '10.0.11.12',
:memory => 512,
:ports => [],
:bootstrap => true,
:synced_folders => false
},
'shipper' => {
:ip => '10.0.11.13',
:memory => 512,
:ports => [],
:bootstrap => true,
:synced_folders => false
},
'kibana' => {
:ip => '10.0.11.14',
:memory => 512,
:ports => [{
:host => 5601,
:guest => 5601
}],
:bootstrap => true,
:synced_folders => false
},
'provisioner' => {
:ip => '10.0.11.15',
:memory => 512,
:ports => [],
:bootstrap => true,
:synced_folders => true
}
}
vms.each_key do |name|
config.vm.define name, :autostart => true do |node|
node.vm.box = 'centos/7'
node.vm.box_version = "2004.01"
node.vm.hostname = name
vms[name][:ports].each do |port_mapping|
node.vm.network :forwarded_port, guest: port_mapping[:guest], host: port_mapping[:host]
end
node.vm.network :private_network, ip: vms[name][:ip]
node.vm.provider :virtualbox do |vb|
vb.name = name
vb.gui = false
vb.memory = vms[name][:memory]
end
if vms[name][:bootstrap]
# Enable provisioning with a shell script.
node.vm.provision :shell, path: "vagrant-scripts/bootstrap-nodes.sh", privileged: false
end
if vms[name][:synced_folders]
node.vm.synced_folder ".", "/vagrant", type: "virtualbox", nfs: true
end
end
end
end