add 8u8 Vagrantfiles
This commit is contained in:
parent
5af819724f
commit
5b62ac6e26
89
rhel/Vagrantfile
vendored
Normal file
89
rhel/Vagrantfile
vendored
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
require 'yaml'
|
||||||
|
|
||||||
|
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
|
||||||
|
VAGRANTFILE_API_VERSION = "2"
|
||||||
|
|
||||||
|
# configs, custom updates defaults
|
||||||
|
defaults_cfg = YAML.load_file('vagrant-settings.yaml_defaults')
|
||||||
|
if File.exist?('vagrant-settings.yaml')
|
||||||
|
custom_cfg = YAML.load_file('vagrant-settings.yaml')
|
||||||
|
cfg = defaults_cfg.merge(custom_cfg)
|
||||||
|
else
|
||||||
|
cfg = defaults_cfg
|
||||||
|
end
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.box = "generic/rhel8"
|
||||||
|
config.vm.hostname = "rhel8u8-repotesting.example.org"
|
||||||
|
|
||||||
|
config.vm.synced_folder "../vagrantdata", "/home/vagrant/data"
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# vb.gui = true is needed so we can modify the initial boot command line in
|
||||||
|
# VirtualBox 7.0.8 on macOS Ventura as there appears to be a regression in
|
||||||
|
# VboxSVGA driver. Possible that a test build of 7.0.9 (or newer) may
|
||||||
|
# resolve but I've not tested that.
|
||||||
|
# For whatever reason in VB7 on macOS removing the vga=792 (1024x768x24)
|
||||||
|
# kernel boot option will temporarily resolve the issue.
|
||||||
|
# Access to the boot menu in VB7 on macOS by pressing fn-F12 early in
|
||||||
|
# the boot sequence and modify kernel boot params to remove vga=792.
|
||||||
|
vb.gui = true
|
||||||
|
vb.memory = "2048"
|
||||||
|
vb.cpus = "2"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Unregister from rhsm if registered
|
||||||
|
config.trigger.before :destroy do |trigger|
|
||||||
|
trigger.warn = "Unregistering from rhsm"
|
||||||
|
trigger.run_remote = {inline: "subscription-manager status || exit 0;subscription-manager remove --all; subscription-manager unregister"}
|
||||||
|
end
|
||||||
|
|
||||||
|
# Must be registered to update and/or install packages
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
subscription-manager register --force \
|
||||||
|
--auto-attach \
|
||||||
|
--username=#{cfg["rhsm_username"]} \
|
||||||
|
--password=#{cfg["rhsm_password"]}
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
dnf -y update
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
dnf -y --enablerepo=epel install diffstat jq python3-jsonpatch rpminspect rpminspect-data-generic vim-enhanced
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
# NOTE: Current generic/rocky8 box is RHEL 8.7 and the above `dnf -y update` will upgrade
|
||||||
|
# it to RHEL 8.8 and will include a new kernel and will break support for VirtualBox
|
||||||
|
# Shared Folders. You will need to build a new kmod for the updated kernel.
|
||||||
|
# In the centos/rocky Vagrant machines this is straight-forward as the boxomatic
|
||||||
|
# boxes leave the build requirements installed. The generic/rhel9 box has these
|
||||||
|
# removed so more work is required to get working vboxsf kmod.
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
dnf install -y gcc make perl kernel-devel kernel-headers bzip2 dkms
|
||||||
|
cd /dev/shm
|
||||||
|
# NOTE: If you are running an older version of VirtualBox probably better to download
|
||||||
|
# matching VBoxGuestAdditions_<ver>.iso and install from that.
|
||||||
|
curl -LOR https://download.virtualbox.org/virtualbox/7.0.8/VBoxGuestAdditions_7.0.8.iso
|
||||||
|
mkdir -p /mnt/virtualbox
|
||||||
|
mount -o loop /dev/shm/VBoxGuestAdditions_7.0.8.iso /mnt/virtualbox
|
||||||
|
/mnt/virtualbox VBoxLinuxAdditions.run --nox11
|
||||||
|
# This will either rebuild the kernel modules for the running kernel or build
|
||||||
|
# the kernel modules for an updated kernel if a newer one exists
|
||||||
|
kver=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel | sort -V | tail -n 1)
|
||||||
|
test -x /sbin/rcvboxadd && /sbin/rcvboxadd quicksetup "${kver}"
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision :reload
|
||||||
|
|
||||||
|
# NOTE: If, after reload, the box doesn't mount the VirtualBox shared folders
|
||||||
|
# try installing the Guest Additions again following the sequence above
|
||||||
|
# and then halt and up the box.
|
||||||
|
|
||||||
|
end
|
||||||
|
|
2
rhel/vagrant-settings.yaml_defaults
Normal file
2
rhel/vagrant-settings.yaml_defaults
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
rhsm_username: admin
|
||||||
|
rhsm_password: secret
|
34
rocky/Vagrantfile
vendored
Normal file
34
rocky/Vagrantfile
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.box = "boxomatic/rocky-8"
|
||||||
|
config.vm.box_version = "20230520.0.1"
|
||||||
|
config.vm.hostname = "rocky8u8-repotesting.example.org"
|
||||||
|
|
||||||
|
config.vm.synced_folder "../vagrantdata", "/home/vagrant/data"
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
vb.memory = "4096"
|
||||||
|
vb.cpus = "2"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
dnf -y update
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
dnf config-manager --set-enabled powertools
|
||||||
|
dnf install -y diffstat jq python3-jsonpatch rpminspect rpminspect-data-fedora vim-enhanced
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
# This will either rebuild the kernel modules for the running kernel or build
|
||||||
|
# the kernel modules for an updated kernel if a newer one exists
|
||||||
|
kver=$(rpm -q --queryformat="%{VERSION}-%{RELEASE}.%{ARCH}\n" kernel | sort -V | tail -n 1)
|
||||||
|
test -x /sbin/rcvboxadd && /sbin/rcvboxadd quicksetup "${kver}"
|
||||||
|
SHELL
|
||||||
|
|
||||||
|
config.vm.provision :reload
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user