2023-06-13 06:04:30 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
# Load overrides
|
|
|
|
require 'yaml'
|
|
|
|
settings_path = '.vagrant_settings'
|
|
|
|
settings = {}
|
|
|
|
|
|
|
|
if File.exist?(settings_path)
|
|
|
|
settings = YAML.load_file(settings_path)
|
|
|
|
end
|
|
|
|
|
|
|
|
VAGRANT_CPUS = settings["VAGRANT_CPUS"] || 2
|
|
|
|
VAGRANT_MEMORY = settings["VAGRANT_MEMORY"] || 4096
|
|
|
|
VAGRANT_NETWORK_NAME = settings["VAGRANT_NETWORK_NAME"] || "vagrant-libvirt"
|
|
|
|
VAGRANT_NETWORK_ADDR = settings["VAGRANT_NETWORK_ADDR"] || "192.168.121.0/24"
|
|
|
|
|
|
|
|
# Vagrant
|
2021-11-27 05:53:58 +00:00
|
|
|
Vagrant.configure("2") do |config|
|
2023-06-13 05:04:39 +00:00
|
|
|
config.vm.box = "debian/bookworm64"
|
2021-11-27 05:53:58 +00:00
|
|
|
config.vm.network "private_network", type: "dhcp"
|
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
|
|
|
2023-06-13 06:04:30 +00:00
|
|
|
# Libvirt settings
|
|
|
|
config.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.cpu_mode = "host-model"
|
|
|
|
libvirt.cpus = VAGRANT_CPUS
|
|
|
|
libvirt.memory = VAGRANT_MEMORY
|
|
|
|
libvirt.management_network_name = VAGRANT_NETWORK_NAME
|
|
|
|
libvirt.management_network_address = VAGRANT_NETWORK_ADDR
|
|
|
|
libvirt.nested = true
|
2023-06-13 05:04:39 +00:00
|
|
|
end
|
|
|
|
|
2021-11-27 05:53:58 +00:00
|
|
|
# Boot with a GUI in VirtualBox
|
|
|
|
config.vm.provider "virtualbox" do |vbox|
|
2021-12-09 01:02:49 +00:00
|
|
|
vbox.customize ["modifyvm", :id, "--vram", "128",
|
|
|
|
"--graphicscontroller", "vboxvga",
|
|
|
|
"--accelerate3d", "on"]
|
2023-06-13 06:04:30 +00:00
|
|
|
vbox.memory = VAGRANT_MEMORY
|
|
|
|
vbox.cpus = VAGRANT_CPUS
|
2021-11-27 05:53:58 +00:00
|
|
|
vbox.gui = true
|
|
|
|
end
|
|
|
|
|
|
|
|
# Provision with Ansible
|
|
|
|
config.vm.provision "ansible" do |ansible|
|
|
|
|
ENV['ANSIBLE_ROLES_PATH'] = File.dirname(__FILE__) + "/roles"
|
|
|
|
ansible.compatibility_mode = "2.0"
|
2023-07-18 05:29:21 +00:00
|
|
|
ansible.playbook = "dev/workstation.yml"
|
|
|
|
ansible.raw_arguments = ["--diff"]
|
2021-11-27 05:53:58 +00:00
|
|
|
end
|
|
|
|
end
|