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: hiera_hash(‘psick::yum_cron::options’, {} ) and merged with a default hash of options



11
12
13
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
43
44
45
46
47
48
# File 'manifests/yum_cron.pp', line 11

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

  $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=hiera_hash('psick::yum_cron::options', {} )
  $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,
    }
  }

}