yum: Added yum::repo::base class which can be used to override default operating system repositories.
This commit is contained in:
parent
ab5f737683
commit
ab8daf97ad
1 changed files with 49 additions and 0 deletions
|
@ -287,6 +287,55 @@ class yum::repo::adobe {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Add operatingsystem base repositories
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# $baseurl:
|
||||||
|
# Location of base repository. If not set default mirrorlist
|
||||||
|
# will be used.
|
||||||
|
#
|
||||||
|
# $updatesurl:
|
||||||
|
# Location of updates repository. If not set default mirrorlist
|
||||||
|
# will be used.
|
||||||
|
#
|
||||||
|
class yum::repo::base($baseurl=undef, $updatesurl=undef) {
|
||||||
|
|
||||||
|
$osname = inline_template("<%= @operatingsystem.downcase() %>")
|
||||||
|
|
||||||
|
case $::operatingsystem {
|
||||||
|
"centos": {
|
||||||
|
file { "/etc/yum.repos.d/CentOS-Base.repo":
|
||||||
|
ensure => absent,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"fedora": { }
|
||||||
|
default: {
|
||||||
|
fail("yum::repo::base not supported in ${::operatingsystem}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
yum::repo { $osname:
|
||||||
|
descr => "${::operatingsystem} - Base",
|
||||||
|
baseurl => $baseurl,
|
||||||
|
mirrorlist => $::operatingsystem ? {
|
||||||
|
"centos" => "http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=os",
|
||||||
|
"fedora" => "https://mirrors.fedoraproject.org/metalink?repo=fedora-\$releasever&arch=\$basearch",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
yum::repo { "${osname}-updates":
|
||||||
|
descr => "${::operatingsystem} - Updates",
|
||||||
|
baseurl => $updatesurl,
|
||||||
|
mirrorlist => $::operatingsystem ? {
|
||||||
|
"centos" => "http://mirrorlist.centos.org/?release=\$releasever&arch=\$basearch&repo=updates",
|
||||||
|
"fedora" => "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f\$releasever&arch=\$basearch",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add CentOS CR (continuous release) repository
|
# Add CentOS CR (continuous release) repository
|
||||||
#
|
#
|
||||||
class yum::repo::centos-cr {
|
class yum::repo::centos-cr {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue