-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
35 lines (29 loc) · 1.19 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
machines = {
"diomaster" => {"memory" => "2048", "cpu" => "2", "ip" => "200", "image" => "bento/ubuntu-20.04"},
"dionode01" => {"memory" => "1024", "cpu" => "2", "ip" => "210", "image" => "bento/ubuntu-20.04"}
# "node02" => {"memory" => "1024", "cpu" => "2", "ip" => "220", "image" => "bento/ubuntu-20.04"},
# "node03" => {"memory" => "1024", "cpu" => "2", "ip" => "230", "image" => "bento/ubuntu-20.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}.diodocker"
machine.vm.network "private_network", ip: "10.20.20.#{conf["ip"]}"
machine.vm.provider "virtualbox" do |vb|
vb.name = "#{name}"
vb.memory = conf["memory"]
vb.cpus = conf["cpu"]
vb.customize ["modifyvm", :id, "--groups", "/DIO-DockerLab"]
end
machine.vm.provision "shell", path: "installdocker.sh"
if "#{name}" == "diomaster"
machine.vm.provision "shell", path: "master.sh"
else
machine.vm.provision "shell", path: "workertoken.sh"
end
end
end
end