-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
35 lines (28 loc) · 1.05 KB
/
Vagrantfile
File metadata and controls
35 lines (28 loc) · 1.05 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
34
35
# -*- mode: ruby -*-
# vi: set ft=ruby :
machines = {
"master" => {"memory" => "512", "cpu" => "1", "ip" => "100", "image" => "bento/ubuntu-22.04"},
"node01" => {"memory" => "512", "cpu" => "1", "ip" => "101", "image" => "bento/ubuntu-22.04"},
"node02" => {"memory" => "512", "cpu" => "1", "ip" => "102", "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.10.#{conf["ip"]}"
machine.vm.provider "virtualbox" do |v|
v.name = "#{name}"
v.memory = conf["memory"]
v.cpus = conf["cpu"]
end
machine.vm.provision "shell", path: "docker.sh"
if "#{name}" == "master"
machine.vm.provision "shell", path: "master.sh"
#machine.vm.provision "shell", path: "portainer.sh"
else
machine.vm.provision "shell", path: "worker.sh"
end
end
end
end