Puppet Class: yum_cron::config

Defined in:
manifests/config.pp

Summary

Manage yum-cron configs

Overview



3
4
5
6
7
8
9
10
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'manifests/config.pp', line 3

class yum_cron::config {
  if $caller_module_name != $module_name {
    fail("Use of private class ${name} by ${caller_module_name}")
  }

  case String($facts['os']['release']['major']) {
    '2', '7': {
      Yum_cron_config {
        notify => $yum_cron::config_notify,
      }

      yum_cron_config { 'commands/update_cmd': value => $yum_cron::update_cmd }
      yum_cron_config { 'commands/update_messages': value => $yum_cron::update_messages }
      yum_cron_config { 'commands/download_updates': value => $yum_cron::download_updates_str }
      yum_cron_config { 'commands/apply_updates': value => $yum_cron::apply_updates_str }
      yum_cron_config { 'commands/random_sleep': value => $yum_cron::randomwait }
      yum_cron_config { 'emitters/system_name': value => $yum_cron::systemname }
      yum_cron_config { 'email/email_to': value => $yum_cron::mailto }
      yum_cron_config { 'email/email_host': value => $yum_cron::email_host }
      yum_cron_config { 'base/debuglevel': value => $yum_cron::debug_level }
      yum_cron_config { 'base/exclude':
        ensure => $yum_cron::exclude_packages_ensure,
        value  => join($yum_cron::exclude_packages, ' '),
      }

      $yum_cron::extra_configs.each |$name, $res| {
        yum_cron_config { $name: * => $res }
      }
      $yum_cron::extra_hourly_configs.each |$name, $res| {
        yum_cron_hourly_config { $name: * => $res }
      }
    }
    default: {
      Dnf_automatic_config {
        notify => $yum_cron::config_notify,
      }

      dnf_automatic_config { 'commands/upgrade_type': value => $yum_cron::upgrade_type }
      dnf_automatic_config { 'commands/upgrade_cmd': ensure => 'absent' }
      dnf_automatic_config { 'commands/update_messages': ensure => 'absent' }
      dnf_automatic_config { 'commands/download_updates': value => $yum_cron::download_updates_str }
      dnf_automatic_config { 'commands/apply_updates': value => $yum_cron::apply_updates_str }
      dnf_automatic_config { 'commands/random_sleep': value => $yum_cron::randomwait }
      dnf_automatic_config { 'emitters/system_name': value => $yum_cron::systemname }
      dnf_automatic_config { 'email/email_to': value => $yum_cron::mailto }
      dnf_automatic_config { 'email/email_host': value => $yum_cron::email_host }
      dnf_automatic_config { 'base/debuglevel': value => $yum_cron::debug_level }
      dnf_automatic_config { 'base/exclude':
        ensure => $yum_cron::exclude_packages_ensure,
        value  => join($yum_cron::exclude_packages, ' '),
      }

      $yum_cron::extra_configs.each |$name, $res| {
        dnf_automatic_config { $name: * => $res }
      }
    }
  }

  if $facts['os']['name'] =~ /Scientific/ and $yum_cron::yum_autoupdate_ensure == 'disabled' {
    file_line { 'disable yum-autoupdate':
      path  => '/etc/sysconfig/yum-autoupdate',
      line  => 'ENABLED=false',
      match => '^ENABLED=.*',
    }
  }
}