Repository navigation
Expand file tree
/
Copy pathVagrantfile
More file actions
executable file
·56 lines (53 loc) · 2.05 KB
/
Copy pathVagrantfile
File metadata and controls
executable file
·56 lines (53 loc) · 2.05 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = {
"host-01" => {
:hostname => "host-01",
:private_ip => "192.168.56.11",
:cpus => "2",
:memory => "2048",
:ports => {
"3000" => "3000", # grafana
"5353" => "5353", # dnscrypt-proxy
"8070" => "8070", # torrserver
"8080" => "8080", # pihole web
"9443" => "9443", # sing-box
"9090" => "9090", # prometheus
"9093" => "9093", # alertmanager
"9100" => "9100" # node-exporter
}
}
}
bookworm_sources = <<-'BOOKWORM_SOURCES'
deb http://deb.debian.org/debian bookworm contrib main non-free-firmware
deb http://deb.debian.org/debian bookworm-updates contrib main non-free-firmware
deb http://deb.debian.org/debian bookworm-backports contrib main non-free-firmware
deb http://deb.debian.org/debian-security bookworm-security contrib main non-free-firmware
BOOKWORM_SOURCES
Vagrant.configure(2) do |config|
boxes.each do |hostname, cfg|
config.vm.box = "bento/debian-12-arm64"
default = if hostname == "server" then true else false end
config.vm.define hostname, primary: default do |config|
config.vm.hostname = cfg[:hostname]
config.vm.provider :vmware_fusion do |v|
v.vmx["ethernet0.pcislotnumber"] = "160"
v.vmx["ethernet1.pcislotnumber"] = "224"
v.ssh_info_public = true
v.linked_clone = false
v.cpus = cfg[:cpus]
v.memory = cfg[:memory]
end
config.vm.network "private_network", ip: cfg[:private_ip]
(cfg[:ports]).each do |guest, host|
config.vm.network "forwarded_port", host: "#{host}", guest: "#{guest}"
end
config.vm.synced_folder ".", "/vagrant"
config.vm.provision "shell", inline: "echo \"#{bookworm_sources}\" > /etc/apt/sources.list"
end
end
if ARGV[0] == "up" then
config.vm.provision "file", source: "~/.ssh/id_ed25519.pub", destination: "/home/vagrant/.ssh/id_ed25519.pub"
config.vm.provision "shell", inline: "cat /home/vagrant/.ssh/id_ed25519.pub >> /home/vagrant/.ssh/authorized_keys"
end
end