summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nagios/manifests/server.pp
blob: a088921a36a95cbc1866eaa6bdbb8d531a39b358 (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
31
32
33
34
35
36
37
38
39
40
class site_nagios::server inherits nagios::base {

  # First, purge old nagios config (see #1467)
  class { 'site_nagios::server::purge':
    stage => setup
  }

  $nagios_hiera=hiera('nagios')
  $nagiosadmin_pw = htpasswd_sha1($nagios_hiera['nagiosadmin_pw'])
  $hosts = $nagios_hiera['hosts']

  include nagios::defaults
  include nagios::base
  #Class ['nagios'] -> Class ['nagios::defaults']
  class {'nagios::apache':
    allow_external_cmd => true,
    stored_config      => false,
    #before             => Class ['nagios::defaults']
  }

  include site_apache::module::headers

  File ['nagios_htpasswd'] {
    source  => undef,
    content => "nagiosadmin:$nagiosadmin_pw",
    mode    => '0640',
  }


  # deploy serverside plugins
  file { '/usr/lib/nagios/plugins/check_openvpn_server.pl':
    source => 'puppet:///modules/nagios/plugins/check_openvpn_server.pl',
    mode   => '0755',
    owner  => 'nagios',
    group  => 'nagios',
  }

  site_nagios::add_host {$hosts:}
  include site_shorewall::monitor
}