forked from fluent/fluent-package-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
59 lines (55 loc) · 1.47 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vms = [
{
:id => "debian-buster-amd64",
:box => "debian/buster64",
},
{
:id => "ubuntu-16.04-x86_64",
:box => "ubuntu/xenial64",
},
{
:id => "ubuntu-18.04-x86_64",
:box => "ubuntu/bionic64",
},
{
:id => "ubuntu-20.04-x86_64",
:box => "ubuntu/focal64",
},
{
:id => "centos-6-x86_64",
:box => "centos/6",
},
{
:id => "centos-7-x86_64",
:box => "centos/7",
},
{
:id => "centos-8-x86_64",
:box => "centos/8",
},
]
vm_id_prefix = ENV["BOX_ID_PREFIX"]
n_cpus = ENV["BOX_N_CPUS"]&.to_i || 2
memory = ENV["BOX_MEMORY"]&.to_i || 2048
vms.each_with_index do |vm, idx|
id = vm[:id]
box = vm[:box] || id
id = "#{vm_id_prefix}#{id}" if vm_id_prefix
config.vm.define(id) do |node|
node.vm.box = box
node.vm.box_url = vm[:box_url]
node.vm.network "private_network", ip: "192.168.35.#{100 + idx}"
node.vm.synced_folder ".", "/vagrant", type: "nfs",
linux__nfs_options: ['rw','no_subtree_check','all_squash','async']
node.vm.provider("virtualbox") do |virtual_box|
virtual_box.cpus = n_cpus if n_cpus
virtual_box.memory = memory if memory
end
end
end
end