Puppet Class: monitoring::service::updates

Defined in:
manifests/service/updates.pp

Overview



2
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
# File 'manifests/service/updates.pp', line 2

class monitoring::service::updates {
  include ::monitoring
  $ensure = $::monitoring::ensure

  monitoring::service { 'updates':
    service_description   => 'UPDATES',
    servicegroups         => 'system',
    check_command         => 'check_nrpe!check_updates',
    normal_check_interval => 1440,
    notification_interval => 1440,
    retry_check_interval  => 720,
    contact_groups        => 'admins,linux_admins',
  }

  monitoring::servicedependency { 'updates':
    dependent_service_description => 'UPDATES',
    service_description           => 'NRPE',
  }

  nrpe::plugin { 'updates':
    ensure        => $ensure,
    plugin        => $::operatingsystem ? {
      default            => 'main',
      /(Debian|Ubunutu)/ => 'main'
    },
    check_command => $::operatingsystem ? {
      default           => 'check_updates',
      /(Debian|Ubuntu)/ => 'check_apt'
    },
    command_args  => $::operatingsystem ? {
      default           => '-t 120 --no-boot-check --security-only',
      /(Debian|Ubuntu)/ => '-t 120'
    },
    sudo          => $::operatingsystem ? {
      default           => false,
      /(Debian|Ubuntu)/ => true
    },
  }

  case $::operatingsystem {
    centos, redhat : {
      if $::operatingsystemmajrelease < 7 {
        package { 'yum-security':
          ensure => installed,
          name   => $::operatingsystemrelease ? {
            default => 'yum-plugin-security',
            /^5/    => 'yum-security'
          },
        }
      }
    }

    fedora         : {
      if $::operatingsystemrelease < 19 {
        package { ['yum-plugin-security']:
          ensure => installed,
        }
      }
    }
  }

}