repotesting-vagrant/rhel/Vagrantfile

64 lines
2.0 KiB
Ruby
Raw Normal View History

2023-05-20 19:13:58 +00:00
# -*- 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.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "2048"
vb.cpus = "2"
end
config.vm.define "rhel8u7" do |rhel8u7|
rhel8u7.vm.box = "generic/rhel8"
rhel8u7.vm.box_version = "4.2.14"
rhel8u7.vm.hostname = "rhel8u7-repotesting.example.org"
rhel8u7.vm.synced_folder "../vagrantdata", "/home/vagrant/data"
rhel8u7.trigger.before :destroy do |trigger|
trigger.warn = "Unregistering from rhsm"
trigger.run_remote = {inline: "subscription-manager remove --all; subscription-manager unregister"}
end
rhel8u7.vm.provision "shell", inline: <<-SHELL
subscription-manager register --force \
--auto-attach \
--username=#{cfg["rhsm_username"]} \
--password=#{cfg["rhsm_password"]}
SHELL
rhel8u7.vm.provision "shell", inline: <<-SHELL
dnf config-manager --set-enabled codeready-builder-for-rhel-8-x86_64-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-appstream-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-baseos-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-highavailability-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-resilientstorage-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-rt-rpms
dnf config-manager --set-enabled rhel-8-for-x86_64-supplementary-rpms
dnf -y update
SHELL
rhel8u7.vm.provision "shell", inline: <<-SHELL
dnf -y --enablerepo=epel install rpminspect rpminspect-data-fedora tree htop vim-enhanced
SHELL
rhel8u7.vm.provision :reload
end
end