-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
executable file
·59 lines (51 loc) · 1.36 KB
/
Copy pathVagrantfile
File metadata and controls
executable file
·59 lines (51 loc) · 1.36 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
MACHINES = {
:otus => {
:box_name => "otus",
:box => "criptobes3301/ubuntu-20.04",
:version => "1.0",
:disk => {
:disk2 => {
:dfile => '../disk-2.vdi',
:size => 4096,
:port => 2
},
:disk3 => {
:dfile => '../disk-3.vdi',
:size => 4096,
:port => 3
},
:disk4 => {
:dfile => '../disk-4.vdi',
:size => 4096,
:port => 4
}
}
},
}
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
MACHINES.each do |boxname, boxconfig|
config.vm.define boxname do |box|
box.vm.hostname = boxconfig[:box_name]
box.vm.box = boxconfig[:box]
box.vm.box_version = boxconfig[:version]
box.vm.network "public_network"
box.vm.provider :virtualbox do |vb|
vb.memory = "1024"
vb.cpus = 1
boxconfig[:disk].each do |dname, dconf|
vb.customize ['createhd', '--filename', dconf[:dfile], '--variant', 'Fixed', '--size', dconf[:size]]
vb.customize [ 'storageattach',
:id,
'--storagectl', 'SATA Controller',
'--port', dconf[:port],
'--device', 0,
'--type', 'hdd',
'--medium', dconf[:dfile]]
end
end
end
end
end