Setup puppet7 repo for el distros
* create that puppet7.repo file * install the puppet-release rpm
This commit is contained in:
parent
52a176fb0e
commit
93c4689d8d
@ -5,3 +5,4 @@ profile::yum::managed_repos:
|
|||||||
- 'extras'
|
- 'extras'
|
||||||
- 'appstream'
|
- 'appstream'
|
||||||
- 'epel'
|
- 'epel'
|
||||||
|
- 'puppet7'
|
||||||
|
|||||||
@ -5,3 +5,4 @@ profile::yum::managed_repos:
|
|||||||
- 'extras'
|
- 'extras'
|
||||||
- 'appstream'
|
- 'appstream'
|
||||||
- 'epel'
|
- 'epel'
|
||||||
|
- 'puppet7'
|
||||||
|
|||||||
@ -95,4 +95,9 @@ class profile::yum::global (
|
|||||||
class { 'profile::yum::epel':
|
class { 'profile::yum::epel':
|
||||||
managed_repos => $managed_repos,
|
managed_repos => $managed_repos,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Setup puppet7 if included in managed_repos
|
||||||
|
class { 'profile::yum::puppet7':
|
||||||
|
managed_repos => $managed_repos,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
59
site/profile/manifests/yum/puppet7.pp
Normal file
59
site/profile/manifests/yum/puppet7.pp
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# Class: profile::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 profile::yum::puppet7
|
||||||
|
#
|
||||||
|
# To specify a custom base URL:
|
||||||
|
# class { 'profile::yum::puppet7':
|
||||||
|
# baseurl => 'http://mylocalmirror.com/yum',
|
||||||
|
# }
|
||||||
|
class profile::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",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user