summaryrefslogtreecommitdiff
path: root/puppet/modules/nagios/manifests/plugins/gpg.pp
blob: a09736a8866d357322b487e8a9d7cc3cfc4d0c4e (plain)
1
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
# check_gpg from
# https://github.com/lelutin/nagios-plugins/blob/master/check_gpg
class nagios::plugins::gpg {
  require ::gpg
  nagios::plugin{'check_gpg':
    source => 'nagios/plugins/check_gpg',
  }

  $gpg_home = '/var/local/nagios_gpg_homedir'
  file{
    $gpg_home:
      ensure  => 'directory',
      owner   => nagios,
      group   => nagios,
      mode    => '0600',
      require => Nagios::Plugin['check_gpg'];
    "${gpg_home}/sks-keyservers.netCA.pem":
      source  => 'puppet:///modules/nagios/plugin_data/sks-keyservers.netCA.pem',
      owner   => nagios,
      group   => 0,
      mode    => '0400',
      before  => Nagios_command['check_gpg'];
  }
  nagios_command {
    'check_gpg':
      command_line => "\$USER1\$/check_gpg --gnupg-homedir ${gpg_home} -w \$ARG1\$ \$ARG2\$",
      require      => Nagios::Plugin['check_gpg'],
  }
}