forked from liquidctl/liquidtux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
73 lines (60 loc) · 2.46 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
CPUS = 4
MEMORY = 1024
USB_IDS = [
# nzxt-grid3
{ :vendor => "0x1e71", :product => "0x1711" },
{ :vendor => "0x1e71", :product => "0x1714" },
# nzxt-kraken2
{ :vendor => "0x1e71", :product => "0x170e" },
# nzxt-kraken3
{ :vendor => "0x1e71", :product => "0x2007" },
{ :vendor => "0x1e71", :product => "0x2014" },
{ :vendor => "0x1e71", :product => "0x3008" },
# nzxt-smart2
{ :vendor => "0x1e71", :product => "0x2006" },
{ :vendor => "0x1e71", :product => "0x200d" },
{ :vendor => "0x1e71", :product => "0x2009" },
{ :vendor => "0x1e71", :product => "0x200e" },
{ :vendor => "0x1e71", :product => "0x200f" },
{ :vendor => "0x1e71", :product => "0x2010" },
]
Vagrant.configure("2") do |config|
config.vm.box = "fedora/37-cloud-base"
config.vm.provider "virtualbox" do |virtualbox, override|
virtualbox.cpus = CPUS
virtualbox.memory = MEMORY
virtualbox.default_nic_type = "virtio"
virtualbox.customize ["modifyvm", :id, "--usbxhci", "on"]
# HACK: only create usb filters once, if vm doesn't exist yet
if not File.exists? File.join(".vagrant", "machines", "default", "virtualbox", "id")
USB_IDS.each_with_index do |usb_id, index|
virtualbox.customize ["usbfilter", "add", index.to_s, "--target", :id, "--name", "dev-#{usb_id[:vendor]}-#{usb_id[:product]}", "--vendorid", usb_id[:vendor], "--productid", usb_id[:product]]
end
end
end
config.vm.provider "libvirt" do |libvirt, override|
libvirt.cpus = CPUS
libvirt.memory = MEMORY
# Error while creating domain: Error saving the server: Call to virDomainDefineXML failed:
# unsupported configuration: chardev 'spicevmc' not supported without spice graphics
libvirt.graphics_type = "spice"
libvirt.channel :type => "spicevmc", :target_name => "com.redhat.spice.0", :target_type => "virtio"
libvirt.usb_controller :model => "qemu-xhci"
libvirt.redirdev :type => "spicevmc"
USB_IDS.each do |usb_id|
libvirt.usb usb_id.merge :startupPolicy => "optional"
end
if Vagrant.has_plugin?("vagrant-libvirt", "> 0.5.3")
libvirt.channel :type => "unix", :target_name => "org.qemu.guest_agent.0", :target_type => "virtio"
libvirt.qemu_use_agent = true
end
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "tools/vagrant/cd-to-vagrant.yml"
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "tools/vagrant/dev-tools.yml"
end
end