Defined Type: yum::plugin

Defined in:
manifests/plugin.pp

Overview

Define: yum::plugin

This definition installs Yum plugin.

Parameters:

[*ensure*]   - specifies if plugin should be present or absent

Actions:

Requires:

RPM based system

Sample usage:

yum::plugin { 'versionlock':
  ensure  => present,
}

Parameters:

  • ensure (Any) (defaults to: present)
  • pkg_prefix (Any) (defaults to: undef)
  • pkg_name (Any) (defaults to: '')


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
# File 'manifests/plugin.pp', line 18

define yum::plugin (
  $ensure     = present,
  $pkg_prefix = undef,
  $pkg_name   = ''
) {
  if $pkg_prefix {
    $_pkg_prefix = $pkg_prefix
  } else {
    $_pkg_prefix = $::operatingsystemmajrelease ? {
      5         => 'yum',
      default   => 'yum-plugin'
    }
  }

  $_pkg_name = $pkg_name ? {
    ''      => "${_pkg_prefix}-${name}",
    default => "${_pkg_prefix}-${pkg_name}"
  }

  package { $_pkg_name:
    ensure  => $ensure,
  }

  if ! defined(Yum::Config['plugins']) {
    yum::config { 'plugins':
      ensure => 1,
    }
  }
}