- change almalinux and epel *.repo files on nodes to use local package mirror - add option to purge yumrepo resources, default to true - add versionlocking to yum, enable it for puppet-agent
59 lines
1.7 KiB
Puppet
59 lines
1.7 KiB
Puppet
# Class: profiles::yum::epel
|
|
#
|
|
# This class manages the puppet7 yum repository for the system.
|
|
#
|
|
# Parameters:
|
|
# -----------
|
|
# - $baseurl: The base URL for the puppet7 yum repository. This should be the root
|
|
# URL of your puppet7 mirror server.
|
|
#
|
|
# Actions:
|
|
# --------
|
|
# - Checks the OS release version.
|
|
#
|
|
# - If the release version is 7, 8, or 9, it sets up the 'puppet7' yum repository
|
|
# and installs the puppet7 release RPM from the provided baseurl.
|
|
#
|
|
# - If the release version is not supported, it raises an error.
|
|
#
|
|
# - The repo configuration includes the baseurl parameterized with the OS
|
|
# release version and architecture, and specifies the GPG key.
|
|
#
|
|
# Example usage:
|
|
# --------------
|
|
# To use this class with the default parameters:
|
|
# include profiles::yum::puppet7
|
|
#
|
|
# To specify a custom base URL:
|
|
# class { 'profiles::yum::puppet7':
|
|
# baseurl => 'http://mylocalmirror.com/yum',
|
|
# }
|
|
class profiles::yum::puppet7 (
|
|
Array[String] $managed_repos,
|
|
String $baseurl = 'http://yum.puppet.com',
|
|
) {
|
|
$releasever = $facts['os']['release']['major']
|
|
$basearch = $facts['os']['architecture']
|
|
|
|
if 'puppet7' in $managed_repos {
|
|
if ($releasever in [7,8,9]) {
|
|
$source = "${baseurl}/puppet7-release-el-${releasever}.noarch.rpm"
|
|
|
|
yum::install { 'puppet-release-el':
|
|
ensure => present,
|
|
source => $source,
|
|
}
|
|
} else {
|
|
err("Unsupported OS release ${releasever}")
|
|
}
|
|
|
|
yumrepo { 'puppet7':
|
|
name => 'puppet7',
|
|
descr => 'puppet7 repository',
|
|
target => '/etc/yum.repos.d/puppet7.repo',
|
|
baseurl => "${baseurl}/puppet/el/${releasever}/${basearch}/",
|
|
gpgkey => "${baseurl}/RPM-GPG-KEY-puppet",
|
|
}
|
|
}
|
|
}
|