-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcigaretteSmokers.Vagrantfile
More file actions
33 lines (28 loc) · 1.04 KB
/
cigaretteSmokers.Vagrantfile
File metadata and controls
33 lines (28 loc) · 1.04 KB
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
Vagrant.configure("2") do |config|
nodes = {
"w0" => { "RUN" => "0" },
"w1" => { "RUN" => "1" }, "w2" => { "RUN" => "2" },
"arbiter" => { "RUN" => "arbiter" }
}
nodes.each do |name, env_vars|
config.vm.define name do |node|
influx_metric_url = ENV['INFLUX_METRIC_URL']
node.vm.box = "generic/ubuntu2004"
ip_suffix = name == "arbiter" ? 10 : 11 + name[1..-1].to_i
node.vm.network "private_network", ip: "192.168.56.#{ip_suffix}"
node.vm.synced_folder "./cigaretteSmokers", "/app/cigaretteSmokers"
node.vm.provision "shell", inline: <<-SHELL
apt-get update -qq && apt-get install -y docker.io
docker rm -f #{name} || true
docker run -d \
--name #{name} \
--network host \
-e RUN=#{env_vars['RUN']} \
-e INFLUX_METRIC_URL=#{influx_metric_url} \
-e METRICS_DIRECTORY="/app/run/metrics_#{name}" \
-v /app/cigaretteSmokers:/app \
collaborativestatemachines/cirrina:unstable
SHELL
end
end
end