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
|
# File 'manifests/plugin.pp', line 14
define yum::plugin (
Enum['present', 'absent'] $ensure = 'present',
Optional[String] $pkg_prefix = undef,
Optional[String] $pkg_name = undef,
) {
if $pkg_prefix {
$_pkg_prefix = $pkg_prefix
} else {
$_pkg_prefix = $facts['os']['release']['major'] ? {
Variant[Integer[5,5], Enum['5']] => 'yum',
default => 'yum-plugin',
}
}
$_pkg_name = $pkg_name ? {
Variant[Enum[''], Undef] => "${_pkg_prefix}-${name}",
default => "${_pkg_prefix}-${pkg_name}",
}
package { $_pkg_name:
ensure => $ensure,
}
if ! defined(Yum::Config['plugins']) {
yum::config { 'plugins':
ensure => 1,
}
}
}
|