yum: Changed yum::repo to allow defining both $mirrorlist and $baseurl. If both are defined the $baseurl will be used.

This commit is contained in:
Timo Mkinen 2013-06-18 15:05:55 +03:00
parent b2b5ec1d25
commit c45f4f149a

View file

@ -189,7 +189,8 @@ class yum::exclude {
# $baseurl: # $baseurl:
# Base URL for this repository. # Base URL for this repository.
# $mirrorlist: # $mirrorlist:
# Mirrorlist URL for this repository. # Mirrorlist URL for this repository. If $baseurl is also set
# this won't have any effect.
# $descr: # $descr:
# Repository description. Defaults to $name. # Repository description. Defaults to $name.
# $gpgkey: # $gpgkey:
@ -218,9 +219,6 @@ define yum::repo($ensure="present", $baseurl="", $mirrorlist="", $descr="", $gpg
if !$baseurl and !$mirrorlist { if !$baseurl and !$mirrorlist {
fail("Either \$baseurl or \$mirrorlist needs to be defined for yum::repo") fail("Either \$baseurl or \$mirrorlist needs to be defined for yum::repo")
} }
if $baseurl and $mirrorlist {
fail("Cannot set both \$baseurl and \$mirrorlist for yum::repo")
}
if regsubst($gpgkey, "^(puppet://).*", '\1') == "puppet://" { if regsubst($gpgkey, "^(puppet://).*", '\1') == "puppet://" {
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-${name}": file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-${name}":