-
Notifications
You must be signed in to change notification settings - Fork 3
/
Vagrantfile
79 lines (70 loc) · 1.65 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
builds = {
'zk-1' => {
id: "11",
ip: "192.168.32.11",
role: "zookeeper",
memory: "1024"
},
'zk-2' => {
id: "12",
ip: "192.168.32.12",
role: "zookeeper",
memory: "1024"
},
'zk-3' => {
id: "13",
ip: "192.168.32.13",
role: "zookeeper",
memory: "1024"
},
'kafka-1' => {
id: "21",
ip: "192.168.32.21",
role: "kafka",
memory: "1024"
},
'kafka-2' => {
id: "22",
ip: "192.168.32.22",
role: "kafka",
memory: "1024"
},
'kafka-3' => {
id: "23",
ip: "192.168.32.23",
role: "kafka",
memory: "1024"
},
'rp-1' => {
ip: "192.168.32.31",
role: "restproxy",
memory: "1024"
},
'rp-2' => {
ip: "192.168.32.32",
role: "restproxy",
memory: "1024"
}
}
Vagrant.configure(2) do |config|
config.vm.box = "ducas/confluent"
builds.each_pair do |name, opts|
config.vm.define name.to_sym do |guest|
guest.vm.network "private_network", ip: opts[:ip]
guest.vm.provider "virtualbox" do |vb|
vb.memory = opts[:memory]
end
case opts[:role]
when "kafka"
guest.vm.provision :shell, run: "always", :path => "run-kafka.sh", :args => "#{opts[:ip]} #{opts[:id]}"
when "zookeeper"
guest.vm.provision :shell, run: "always", :path => "run-zookeeper.sh", :args => "#{opts[:id]}"
when "restproxy"
guest.vm.provision :shell, run: "always", :path => "run-schemaregistry.sh", :args => "#{opts[:ip]}"
guest.vm.provision :shell, run: "always", :path => "run-restproxy.sh", :args => "#{opts[:ip]} #{opts[:id]}"
end
end
end
end