# Class: profiles::yum::epel # # This class manages the EPEL yum repository for the system. # # Parameters: # ----------- # - $baseurl: The base URL for the EPEL yum repository. This should be the root # URL of your EPEL mirror server. # # Actions: # -------- # - Checks the OS release version. # # - If the release version is 7, 8, or 9, it sets up the 'epel' yum repository # and installs the EPEL 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::epel # # To specify a custom base URL: # class { 'profiles::yum::epel': # baseurl => 'http://mylocalmirror.com/yum', # } class profiles::yum::epel ( Array[String] $managed_repos, String $baseurl, ) { $releasever = $facts['os']['release']['major'] $basearch = $facts['os']['architecture'] if 'epel' in $managed_repos { if ($releasever in [7,8,9]) { $source = "${baseurl}/epel-release-latest-${releasever}.noarch.rpm" yum::install { 'epel-release': ensure => present, source => $source, } } else { err("Unsupported OS release ${releasever}") } yumrepo { 'epel': name => 'epel', descr => 'epel repository', target => '/etc/yum.repos.d/epel.repo', baseurl => "${baseurl}/${releasever}/Everything/${basearch}/", gpgkey => "${baseurl}/RPM-GPG-KEY-EPEL-${releasever}", } } }