-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
34 lines (28 loc) · 1.13 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
machines = {
"master-project" => {"memory" => "1024", "cpu" => "1", "ip" => "250", "image" => "bento/ubuntu-22.04"},
"node-project01" => {"memory" => "1024", "cpu" => "1", "ip" => "251", "image" => "bento/ubuntu-22.04"},
"node-project-02" => {"memory" => "1024", "cpu" => "1", "ip" => "252", "image" => "bento/ubuntu-22.04"},
"node-project-03" => {"memory" => "1024", "cpu" => "1", "ip" => "253", "image" => "bento/ubuntu-22.04"}
}
Vagrant.configure("2") do |config|
machines.each do |name, conf|
config.vm.define "#{name}" do |machine|
machine.vm.box = "#{conf["image"]}"
machine.vm.hostname = "#{name}"
machine.vm.network "private_network", ip: "10.10.0.#{conf["ip"]}"
machine.vm.provider "virtualbox" do |vb|
vb.name = "#{name}"
vb.memory = conf["memory"]
vb.cpus = conf["cpu"]
end
machine.vm.provision "shell", path: "docker.sh"
if "#{name}" == "master-project"
machine.vm.provision "shell", path: "master.sh"
else
machine.vm.provision "shell", path: "worker.sh"
end
end
end
end