forked from dmitry-lyutenko/manual_kernel_update
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
51 lines (50 loc) · 1.64 KB
/
Vagrantfile
File metadata and controls
51 lines (50 loc) · 1.64 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
# Describe VMs
MACHINES = {
# VM name "kernel update"
:"kernel-update" => {
# VM box
:box_name => "incertov/centos-7-5",
# VM CPU count
:cpus => 2,
# VM RAM size (Mb)
:memory => 1024,
# forwarded ports
:forwarded_port => []
#:forwarded_port => [guest: 22, host: 2200, protocol: "tcp"]
}
}
Vagrant.configure("2") do |config|
MACHINES.each do |boxname, boxconfig|
# Disable shared folders
config.vm.synced_folder ".", "/vagrant", disabled: true
# Disable audio
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--audio", "none"]
end
# Apply VM config
config.vm.define boxname do |box|
# Set VM base box and hostname
box.vm.box = boxconfig[:box_name]
box.vm.host_name = boxname.to_s
# Additional network config if present
#config.vm.network "private_network", adapter: 2, ip: '10.10.10.2', netmask: "255.255.255.0"
#config.vm.network "public_network", adapter: 3, type: "dhcp", bridge: "enp3s0"
# default router
#config.vm.provision "shell",
# run: "always",
# inline: "route add default gw 192.168.88.1"
# Port-forward config if present
if boxconfig.key?(:forwarded_port)
boxconfig[:forwarded_port].each do |port|
box.vm.network "forwarded_port", port
end
end
# VM resources config
box.vm.provider "virtualbox" do |v|
# Set VM RAM size and CPU count
v.memory = boxconfig[:memory]
v.cpus = boxconfig[:cpus]
end
end
end
end