Last active
December 28, 2022 03:18
-
-
Save craig-m/bb72aecc743c6ce0d9bb5563c030ee46 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rocky Linux 9 Vagrant for VirtualBox and LibVirt hosts | |
Vagrant.require_version ">= 2.2.14" | |
BOX_BASE_URL = "https://download.rockylinux.org/pub/rocky/9.1/images/x86_64/" | |
BOX_PREFIX = "Rocky-9-Vagrant-" | |
BOX_PREFIX_V = "-9.1-20221213.0.x86_64.box" | |
BOXSHA_VB = "e5430e655dbc142f886d319cfde71a84fd6c4c5a980af27b92cebd07fb3dd01b" | |
BOXSHA_LV = "205a660088b12bacdfcbe24c49cd1e3d9c4e312cce09c3ddc893e8024299c5a9" | |
$script_prov_root = <<-SCRIPT | |
dnf update -x kernel-* -y | |
dnf install -y cockpit vim tmux | |
systemctl enable cockpit.socket | |
systemctl start cockpit.socket | |
loginctl enable-linger vagrant | |
SCRIPT | |
$script_prov_user = <<-SCRIPT | |
mkdir -pv ~/{.local,temp,downloads} | |
SCRIPT | |
Vagrant.configure("2") do |config| | |
config.vm.box = "rockylinux/9" | |
# VM options | |
config.vm.box_check_update = false | |
config.vm.synced_folder "./source", "/vagrant", disabled: true | |
config.ssh.insert_key = true | |
config.ssh.username = "vagrant" | |
config.ssh.password = "vagrant" | |
config.ssh.keep_alive = true | |
config.ssh.compression = false | |
config.ssh.forward_agent = false | |
# VirtualBox | |
config.vm.provider :virtualbox do |virtualbox, override| | |
override.vm.box_url = BOX_BASE_URL + BOX_PREFIX + "Vbox" + BOX_PREFIX_V | |
override.vm.box_download_checksum_type = "sha256" | |
override.vm.box_download_checksum = BOXSHA_VB | |
# sys | |
virtualbox.gui = false | |
virtualbox.memory = 4096 | |
virtualbox.cpus = 4 | |
virtualbox.check_guest_additions = true | |
end | |
# LibVirt | |
config.vm.provider :libvirt do |libv, override| | |
override.vm.box_url = BOX_BASE_URL + BOX_PREFIX + "Libvirt" + BOX_PREFIX_V | |
override.vm.box_download_checksum_type = "sha256" | |
override.vm.box_download_checksum = BOXSHA_LV | |
end | |
config.vm.network :forwarded_port, guest: 9090, host: 9090, id: 'cockpit' | |
config.vm.provision :shell, | |
name: "root setup script", | |
inline: $script_prov_root, | |
:privileged => true | |
config.vm.provision :shell, | |
name: "user setup script", | |
inline: $script_prov_user, | |
:privileged => false | |
end | |
# vim: set filetype=ruby: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment