Puppet Class: psick::repo
- Defined in:
- manifests/repo.pp
Overview
Generic repo management wrapper class Repos to create, besides default ones (when use_defaults = true) are looked up via lookup
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'manifests/repo.pp', line 5
class psick::repo (
Boolean $use_defaults = true,
String $yum_resource = 'yumrepo', # Native resource type
Hash $yum_repos = {},
String $apt_resource = 'apt::source', # From puppetlabs-apt
Hash $apt_repos = {},
String $zypper_resource = 'zypprepo', # From darin-zypprepo
Hash $zypper_repos = {},
Boolean $manage = $psick::manage,
Boolean $noop_manage = $psick::noop_manage,
Boolean $noop_value = $psick::noop_value,
) {
if $manage {
if $noop_manage {
noop($noop_value)
}
# Default repos
if $use_defaults {
case $facts['os']['family'] {
'RedHat': {
tp::repo { 'epel': }
}
'Debian': {
}
'Suse': {
}
default: {
}
}
}
# Not converted to Puppet 4 style for easier variables management.
if $yum_repos != {} {
create_resources($yum_resource, $yum_repos)
}
if $apt_repos != {} {
create_resources($apt_resource, $apt_repos)
}
if $yum_repos != {} {
create_resources($zypper_resource, $yum_repos)
}
}
}
|