-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathboxes.rb
115 lines (110 loc) · 3.09 KB
/
boxes.rb
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/ruby
#
APT_ENV_VARS = {
'DEBIAN_FRONTEND': 'noninteractive',
'DEBCONF_NONINTERACTIVE_SEEN': true,
}
INSTALL_ENV_VARS = {
'VAGRANT_LIBVIRT_VERSION': ENV.fetch('QA_VAGRANT_LIBVIRT_VERSION', 'latest'),
}
BOXES = {
'ubuntu-18.04' => {
:libvirt => {
:box => "generic/ubuntu1804",
:provision => [
{:inline => 'ln -sf ../run/systemd/resolve/resolv.conf /etc/resolv.conf'},
],
},
},
'ubuntu-20.04' => {
:libvirt => {
:box => "generic/ubuntu2004",
:provision => [
{:inline => 'ln -sf ../run/systemd/resolve/resolv.conf /etc/resolv.conf'},
],
},
},
'ubuntu-22.04' => {
:libvirt => {
:box => "generic/ubuntu2204",
:provision => [
{:inline => 'ln -sf ../run/systemd/resolve/resolv.conf /etc/resolv.conf'},
],
},
},
'debian-10' => {
:libvirt => {
:box => "generic/debian10",
:provision => [
{:name => 'disable dns-nameservers', :inline => 'sed -i -e "/^dns-nameserver/g" /etc/network/interfaces', :reboot => true},
# restarting dnsmasq can require a retry after everything else to come up correctly.
{:name => 'install dnsmasq', :inline => 'apt update && apt install -y dnsmasq && systemctl restart dnsmasq', :env => APT_ENV_VARS},
],
},
},
'debian-11' => {
:libvirt => {
:box => "generic/debian11",
:provision => [
{:name => 'disable dns-nameservers', :inline => 'sed -i -e "/^dns-nameserver/g" /etc/network/interfaces', :reboot => true},
# restarting dnsmasq can require a retry after everything else to come up correctly.
{:name => 'install dnsmasq', :inline => 'apt update && apt install -y dnsmasq && systemctl restart dnsmasq', :env => APT_ENV_VARS},
],
},
},
'centos-7' => {
:libvirt => {
:box => "generic/centos7",
},
},
'centos-8' => {
:libvirt => {
:box => "generic/centos8",
},
},
'centos-8-stream' => {
:libvirt => {
:box => "generic/centos8s",
},
},
'centos-9-stream' => {
:libvirt => {
:box => "generic/centos9s",
},
},
'fedora-34' => {
:libvirt => {
:box => "generic/fedora34",
},
},
'fedora-35' => {
:libvirt => {
:box => "generic/fedora35",
},
},
'fedora-36' => {
:libvirt => {
:box => "generic/fedora36",
},
},
'archlinux' => {
:libvirt => {
:box => "archlinux/archlinux",
},
},
'opensuse-leap' => {
:libvirt => {
:box => "opensuse/Leap-15.4.x86_64",
},
},
}
DEFAULT_PROVISION = [
{:name => 'install script', :privileged => false, :path => './scripts/install.bash', :args => ENV['QA_VAGRANT_VERSION'].nil? ? "" : "--vagrant-version #{ENV['QA_VAGRANT_VERSION']}", :env => INSTALL_ENV_VARS},
{:name => 'setup group', :reset => true, :inline => 'usermod -a -G libvirt vagrant'},
{:name => 'debug system capabilities', :privileged => false, :inline => 'virsh --connect qemu:///system capabilities'},
{:name => 'debug uri', :privileged => false, :inline => 'virsh uri'},
]
if __FILE__ == $0
require 'json'
puts JSON.pretty_generate(BOXES)
end