feat: add ovirt roles
- add repositories for ovirt - add role/profile for ovirt/engine and ovirt/node - add deep-merge for managed_repos - change repos to allow filesource (URL or file://) - change reposync to use curl instead of wget
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# profiles::ovirt::node
|
||||
class profiles::ovirt::node {
|
||||
# Define the DNF modules to be enabled
|
||||
$dnf_modules_to_enable = {
|
||||
'javapackages-tools' => { 'ensure' => 'latest' },
|
||||
'pki-deps' => { 'ensure' => 'latest' },
|
||||
'postgresql' => { 'ensure' => '12' },
|
||||
'mod_auth_openidc' => { 'ensure' => '2.3' },
|
||||
'nodejs' => { 'ensure' => '14' },
|
||||
}
|
||||
|
||||
# Enable the DNF modules
|
||||
create_resources(
|
||||
'package',
|
||||
$dnf_modules_to_enable, {
|
||||
provider => dnfmodule,
|
||||
enable_only => true
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -4,7 +4,7 @@ define profiles::reposync::repos (
|
||||
String $description,
|
||||
String $osname,
|
||||
String $release,
|
||||
Stdlib::HTTPUrl $gpgkey,
|
||||
Stdlib::Filesource $gpgkey,
|
||||
String $arch = 'x86_64',
|
||||
String $repo_owner = 'root',
|
||||
String $repo_group = 'root',
|
||||
|
||||
@@ -96,6 +96,12 @@ class profiles::yum::global (
|
||||
require => Class['profiles::pki::vaultca'],
|
||||
}
|
||||
|
||||
# Setup ovirt repo if included in managed_repos
|
||||
class { 'profiles::yum::ovirt':
|
||||
managed_repos => $managed_repos,
|
||||
require => Class['profiles::pki::vaultca'],
|
||||
}
|
||||
|
||||
# setup dnf-autoupdate
|
||||
include profiles::yum::autoupdater
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# Class: profiles::yum::ovirt
|
||||
class profiles::yum::ovirt (
|
||||
Array[String] $managed_repos,
|
||||
String $baseurl,
|
||||
Enum[
|
||||
'daily',
|
||||
'weekly',
|
||||
'monthly'
|
||||
] $snapshot = 'daily',
|
||||
) {
|
||||
$release = $facts['os']['release']['major']
|
||||
$basearch = $facts['os']['architecture']
|
||||
|
||||
$centos_nonstream = [
|
||||
'virt-advanced-virtualization',
|
||||
'storage-ceph-pacific'
|
||||
]
|
||||
$centos_stream = [
|
||||
'cloud-openstack-xena',
|
||||
'messaging-rabbitmq-38',
|
||||
'nfv-openvswitch-2',
|
||||
'opstools-collectd-5',
|
||||
'storage-gluster-10',
|
||||
'virt-ovirt-45'
|
||||
]
|
||||
$centos_nonstream.each |$name| {
|
||||
if $name in $managed_repos {
|
||||
yumrepo { $name:
|
||||
name => $name,
|
||||
descr => $name,
|
||||
target => '/etc/yum.repos.d/ovirt.repo',
|
||||
baseurl => "${baseurl}/${release}/${name}-20240311/${basearch}/os/",
|
||||
gpgcheck => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
$centos_stream.each |$name| {
|
||||
if $name in $managed_repos {
|
||||
yumrepo { $name:
|
||||
name => $name,
|
||||
descr => $name,
|
||||
target => '/etc/yum.repos.d/ovirt.repo',
|
||||
baseurl => "${baseurl}/${release}-stream/${name}-20240311/${basearch}/os/",
|
||||
gpgcheck => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ download_gpg_key() {
|
||||
local filename=$(basename "$gpgkeyurl")
|
||||
|
||||
# Download GPG key to the specified path with the filename from the URL
|
||||
wget -q -O "${basepath}/live/${reponame}/${filename}" "$gpgkeyurl" || {
|
||||
curl -s --create-dirs -o "${basepath}/live/${reponame}/${filename}" "$gpgkeyurl" || {
|
||||
echo "Failed to download GPG key from $gpgkeyurl"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
class roles::infra::ovirt::node {
|
||||
include profiles::defaults
|
||||
include profiles::base
|
||||
include profiles::ovirt::node
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user