-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
50 lines (47 loc) · 1.58 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
# Copyright (C) 2023 Sutou Kouhei <[email protected]>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# 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-bookworm-amd64",
:box => "bento/debian-12",
},
{
:id => "debian-bookworm-arm64",
:box => "bento/debian-12-arm64",
},
]
n_cpus = ENV["VM_N_CPUS"] || 2
n_cpus = Integer(n_cpus) if n_cpus
memory = ENV["VM_MEMORY"] || 1024
memory = Integer(memory) if memory
vms.each do |vm|
id = vm[:id]
box = vm[:box] || id
config.vm.define(id) do |node|
node.vm.box = box
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