Puppet Class: yum::plugin::versionlock

Inherits:
::yum::params
Defined in:
manifests/plugin/versionlock.pp

Overview

Manage the Yum versionlock plugin.

Examples:

Declaring the class

include ::yum
include ::yum::plugin::versionlock

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')
  • enable (Boolean) (defaults to: true)
  • package_name (String) (defaults to: $::yum::params::versionlock_package_name)
  • follow_obsoletes (Optional[Boolean]) (defaults to: undef)
  • locklist (Stdlib::Absolutepath) (defaults to: "${::yum::pluginconf_dir}/versionlock.list")
  • show_hint (Optional[Boolean]) (defaults to: $::yum::params::versionlock_show_hint)

See Also:

Since:

  • 1.0.0



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

class yum::plugin::versionlock (
  Enum['present', 'absent'] $ensure           = 'present',
  Boolean                   $enable           = true,
  String                    $package_name     = $::yum::params::versionlock_package_name,
  Optional[Boolean]         $follow_obsoletes = undef,
  Stdlib::Absolutepath      $locklist         = "${::yum::pluginconf_dir}/versionlock.list",
  Optional[Boolean]         $show_hint        = $::yum::params::versionlock_show_hint,
) inherits ::yum::params {

  if ! defined(Class['::yum']) {
    fail('You must include the yum base class before using the yum::plugin::versionlock class')
  }

  package { $package_name:
    ensure => $ensure,
    tag    => [
      "bodgit::${module_name}",
    ],
  }

  if $ensure == 'present' {
    ::yum::plugin { 'versionlock':
      content => template("${module_name}/versionlock.conf.erb"),
      require => Package[$package_name],
    }

    ::concat { $locklist:
      owner => 0,
      group => 0,
      mode  => '0644',
    }
  }
}