-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
77 lines (71 loc) · 1.57 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 tw=0 et :
role = File.basename(File.expand_path(File.dirname(__FILE__)))
boxes = [
{
:name => "ubuntu-1804",
:box => "bento/ubuntu-18.04",
:ip => '10.0.0.13',
:cpu => "50",
:ram => "384"
},
{
:name => "ubuntu-2004",
:box => "bento/ubuntu-20.04",
:ip => '10.0.0.14',
:cpu => "50",
:ram => "512"
},
{
:name => "ubuntu-2204",
:box => "bento/ubuntu-22.04",
:ip => '10.0.0.15',
:cpu => "50",
:ram => "512"
},
{
:name => "ubuntu-2404",
:box => "bento/ubuntu-24.04",
:ip => '10.0.0.16',
:cpu => "50",
:ram => "512"
},
{
:name => "debian-10",
:box => "bento/debian-10",
:ip => '10.0.0.18',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-11",
:box => "bento/debian-11",
:ip => '10.0.0.19',
:cpu => "50",
:ram => "256"
},
{
:name => "debian-12",
:box => "bento/debian-12",
:ip => '10.0.0.20',
:cpu => "50",
:ram => "384"
},
]
Vagrant.configure("2") do |config|
boxes.each do |box|
config.vm.define box[:name] do |vms|
vms.vm.box = box[:box]
vms.vm.hostname = "ansible-#{role}-#{box[:name]}"
vms.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--cpuexecutioncap", box[:cpu]]
v.customize ["modifyvm", :id, "--memory", box[:ram]]
end
vms.vm.network :private_network, ip: box[:ip]
vms.vm.provision :ansible do |ansible|
ansible.playbook = "tests/vagrant.yml"
ansible.verbose = "vv"
end
end
end
end