-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
38 lines (34 loc) · 805 Bytes
/
Vagrantfile
File metadata and controls
38 lines (34 loc) · 805 Bytes
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
boxes = [
{
name: "srv1",
box: "cloud-image/ubuntu-24.04",
hostname: "srv1.local",
memory: 2048,
cpus: 2,
ip: "192.168.56.111"
},
{
name: "srv2",
box: "cloud-image/ubuntu-24.04",
hostname: "srv2.local",
memory: 1024,
cpus: 1,
ip: "192.168.56.112"
}
]
Vagrant.require_version ">= 2.0.0"
Vagrant.configure("2") do |config|
config.ssh.insert_key = false
# Configure all VMs
boxes.each_with_index do |box, index|
config.vm.define box[:name] do |box_config|
box_config.vm.box = box[:box]
box_config.vm.hostname = box[:hostname]
box_config.vm.network "private_network", ip: box[:ip]
box_config.vm.provider "virtualbox" do |vb|
vb.memory = box[:memory]
vb.cpus = box[:cpus]
end
end
end
end