equal
deleted
inserted
replaced
|
1 # Define: yum::plugin |
|
2 # |
|
3 # This definition installs Yum plugin. |
|
4 # |
|
5 # Parameters: |
|
6 # [*ensure*] - specifies if plugin should be present or absent |
|
7 # |
|
8 # Actions: |
|
9 # |
|
10 # Requires: |
|
11 # RPM based system |
|
12 # |
|
13 # Sample usage: |
|
14 # yum::plugin { 'versionlock': |
|
15 # ensure => present, |
|
16 # } |
|
17 # |
|
18 define yum::plugin ( |
|
19 $ensure = present, |
|
20 $pkg_prefix = 'yum-plugin', |
|
21 $pkg_name = '' |
|
22 ) { |
|
23 $_pkg_name = $pkg_name ? { |
|
24 '' => "${pkg_prefix}-${name}", |
|
25 default => "${pkg_prefix}-${pkg_name}" |
|
26 } |
|
27 |
|
28 package { $_pkg_name: |
|
29 ensure => $ensure, |
|
30 } |
|
31 |
|
32 if ! defined(Yum::Config['plugins']) { |
|
33 yum::config { 'plugins': |
|
34 ensure => 1, |
|
35 } |
|
36 } |
|
37 } |