Puppet Class: psick::yum::cron

Defined in:
manifests/yum/cron.pp

Overview

This class installs and configures yum-cron

Parameters:

  • ensure (Enum['present','absent']) (defaults to: 'present')

    Define if to install or remove yum-cron

  • config_file_template (String) (defaults to: 'psick/yum_cron/yum-cron.conf.erb')

    The path of the erb template (as used in template) used for the content of yum-cron config file.

  • options

    An hash of custon options to use in the config_file_template Note: This is not a class parameter but a key lookup up via: lookup(‘psick::yum::cron::options’, {} ) and merged with a default hash of options

  • manage (Boolean) (defaults to: $psick::manage)

    If to actually manage any resource in this class. If false no resource is managed. Default value is taken from main psick class.

  • noop_manage (Boolean) (defaults to: $psick::noop_manage)

    If to use the noop() function for all the resources provided by this class. If this is true the noop function is called with $noop_value argument. This overrides any other noop setting (either set on client’s puppet.conf or by noop() function in main psick class). Default from psick class.

  • noop_value (Boolean) (defaults to: $psick::noop_value)

    The value to pass to noop() function if noop_manage is true. It applies to all the resources (and classes) declared in this class If true: noop metaparamenter is set to true, resources are not applied If false: noop metaparameter is set to false, and any eventual noop setting is overridden: resources are always applied. Default from psick class.

[View source]

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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'manifests/yum/cron.pp', line 23

class psick::yum::cron (
  Enum['present','absent'] $ensure = 'present',
  String $config_file_template     = 'psick/yum_cron/yum-cron.conf.erb',

  Boolean $manage                  = $psick::manage,
  Boolean $noop_manage             = $psick::noop_manage,
  Boolean $noop_value              = $psick::noop_value,
) {
  if $manage {
    if $noop_manage {
      noop($noop_value)
    }
    $options_default = {
      'update_cmd' => 'default',
      'update_messages' => 'yes',
      'download_updates' => 'yes',
      'apply_updates' => 'yes',
      'random_sleep' => '360',
      'system_name' => 'None',
      'emit_via' => 'stdio',
      'output_width' => '80',
      'email_from' => 'root@localhost',
      'email_to' => 'root',
      'email_host' => 'localhost',
      'group_list' => 'None',
      'group_package_types' => 'mandatory, default',
      'debuglevel' => '-2',
      'mdpolicy' => 'group:main',
    }
    $options_user=lookup('psick::yum::cron::options', Hash, 'deep', {})
    $options=merge($options_default,$options_user)

    ::tp::install { 'yum-cron':
      ensure => $ensure,
    }

    if $config_file_template != '' {
      ::tp::conf { 'yum-cron':
        ensure       => $ensure,
        template     => $config_file_template,
        options_hash => $options,
      }
    }
  }
}