summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-03-10 20:23:29 +0100
committervarac <varacanero@zeromail.org>2016-03-10 20:23:29 +0100
commitdd7443163c1471b847549de1d6d2ee7606079ee7 (patch)
tree52b8ec2c5faa4c63e4cec11052e0bcdb3c190fed
parent4081c66952614743b60b5031791cb43d23d48fa1 (diff)
parentf062559072e7d4281c114d799208a3d093a74a47 (diff)
Merge remote-tracking branch 'shared/master' into leap_master
-rw-r--r--manifests/base.pp64
-rw-r--r--manifests/debian.pp3
-rw-r--r--manifests/defaults/pnp4nagios.pp10
-rw-r--r--manifests/pnp4nagios.pp25
4 files changed, 64 insertions, 38 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 1ba0679..18d5c12 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -69,9 +69,9 @@ class nagios::base {
if $cfg_dir == '/etc/nagios3' {
file{'/etc/nagios':
- ensure => link,
- target => $cfg_dir,
- require => Package['nagios'],
+ ensure => link,
+ target => $cfg_dir,
+ before => File['nagios_cfgdir'],
}
}
@@ -94,34 +94,50 @@ class nagios::base {
ensure => file,
replace => false,
notify => Service['nagios'],
+ require => File['nagios_cfgdir'],
owner => root,
group => 0,
mode => '0644';
}
- if $nagios::purge_resources {
- resources {
- [
- 'nagios_command',
- 'nagios_contactgroup',
- 'nagios_contact',
- 'nagios_hostdependency',
- 'nagios_hostescalation',
- 'nagios_hostextinfo',
- 'nagios_hostgroup',
- 'nagios_host',
- 'nagios_servicedependency',
- 'nagios_serviceescalation',
- 'nagios_servicegroup',
- 'nagios_serviceextinfo',
- 'nagios_service',
- 'nagios_timeperiod',
- ]:
- notify => Service['nagios'],
- purge => true;
- }
+ resources {
+ [
+ 'nagios_command',
+ 'nagios_contactgroup',
+ 'nagios_contact',
+ 'nagios_hostdependency',
+ 'nagios_hostescalation',
+ 'nagios_hostextinfo',
+ 'nagios_hostgroup',
+ 'nagios_host',
+ 'nagios_servicedependency',
+ 'nagios_serviceescalation',
+ 'nagios_servicegroup',
+ 'nagios_serviceextinfo',
+ 'nagios_service',
+ 'nagios_timeperiod',
+ ]:
+ notify => Service['nagios'],
+ purge => $::nagios::purge_resources
}
+ # make sure nagios resources are defined after nagios is
+ # installed and the nagios_cfgdir resource is present
+ File['nagios_cfgdir'] -> Nagios_command <||>
+ File['nagios_cfgdir'] -> Nagios_contactgroup <||>
+ File['nagios_cfgdir'] -> Nagios_contact <||>
+ File['nagios_cfgdir'] -> Nagios_hostdependency <||>
+ File['nagios_cfgdir'] -> Nagios_hostescalation <||>
+ File['nagios_cfgdir'] -> Nagios_hostextinfo <||>
+ File['nagios_cfgdir'] -> Nagios_hostgroup <||>
+ File['nagios_cfgdir'] -> Nagios_host <||>
+ File['nagios_cfgdir'] -> Nagios_servicedependency <||>
+ File['nagios_cfgdir'] -> Nagios_serviceescalation <||>
+ File['nagios_cfgdir'] -> Nagios_servicegroup <||>
+ File['nagios_cfgdir'] -> Nagios_serviceextinfo <||>
+ File['nagios_cfgdir'] -> Nagios_service <||>
+ File['nagios_cfgdir'] -> Nagios_timeperiod <||>
+
if ( $nagios::storeconfigs == true ) {
include ::nagios::storeconfigs
}
diff --git a/manifests/debian.pp b/manifests/debian.pp
index b5d6974..39af973 100644
--- a/manifests/debian.pp
+++ b/manifests/debian.pp
@@ -36,16 +36,19 @@ class nagios::debian inherits nagios::base {
unless => 'dpkg-statoverride --list nagios www-data 2710 /var/lib/nagios3/rw && dpkg-statoverride --list nagios nagios 751 /var/lib/nagios3',
logoutput => false,
notify => Service['nagios'],
+ require => Package['nagios'],
}
exec { 'nagios_external_cmd_perms_1':
command => 'chmod 0751 /var/lib/nagios3 && chown nagios:nagios /var/lib/nagios3',
unless => 'test "`stat -c "%a %U %G" /var/lib/nagios3`" = "751 nagios nagios"',
notify => Service['nagios'],
+ require => Package['nagios'],
}
exec { 'nagios_external_cmd_perms_2':
command => 'chmod 2751 /var/lib/nagios3/rw && chown nagios:www-data /var/lib/nagios3/rw',
unless => 'test "`stat -c "%a %U %G" /var/lib/nagios3/rw`" = "2751 nagios www-data"',
notify => Service['nagios'],
+ require => Package['nagios'],
}
}
}
diff --git a/manifests/defaults/pnp4nagios.pp b/manifests/defaults/pnp4nagios.pp
index 662d13b..58676c5 100644
--- a/manifests/defaults/pnp4nagios.pp
+++ b/manifests/defaults/pnp4nagios.pp
@@ -1,10 +1,14 @@
+# configure default cmds for pnp4nagios
class nagios::defaults::pnp4nagios {
- # performance data cmds
+
+ # performance data cmds
# http://docs.pnp4nagios.org/de/pnp-0.6/config#bulk_mode_mit_npcd
nagios_command {
'process-service-perfdata-file-pnp4nagios-bulk-npcd':
- command_line => '/bin/mv /var/lib/nagios3/service-perfdata /var/spool/pnp4nagios/npcd/service-perfdata.$TIMET$';
+ command_line => '/bin/mv /var/lib/nagios3/service-perfdata /var/spool/pnp4nagios/npcd/service-perfdata.$TIMET$',
+ require => Package['nagios'];
'process-host-perfdata-file-pnp4nagios-bulk-npcd':
- command_line => '/bin/mv /var/lib/nagios3/host-perfdata /var/spool/pnp4nagios/npcd/host-perfdata.$TIMET$'
+ command_line => '/bin/mv /var/lib/nagios3/host-perfdata /var/spool/pnp4nagios/npcd/host-perfdata.$TIMET$',
+ require => Package['nagios'];
}
}
diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp
index a7e1c73..32c9a33 100644
--- a/manifests/pnp4nagios.pp
+++ b/manifests/pnp4nagios.pp
@@ -18,6 +18,7 @@ class nagios::pnp4nagios {
owner => root,
group => root,
notify => Service['nagios'],
+ require => Package['nagios'];
}
file { 'apache.conf':
@@ -28,19 +29,20 @@ class nagios::pnp4nagios {
owner => root,
group => root,
notify => Service['apache'],
- require => Package['pnp4nagios'],
+ require => [ Package['apache2'], Package['pnp4nagios'] ],
}
# run npcd as daemon
file { '/etc/default/npcd':
- path => '/etc/default/npcd',
- source => [ 'puppet:///modules/site_nagios/pnp4nagios/npcd',
+ path => '/etc/default/npcd',
+ source => [ 'puppet:///modules/site_nagios/pnp4nagios/npcd',
'puppet:///modules/nagios/pnp4nagios/npcd' ],
- mode => '0644',
- owner => root,
- group => root,
- notify => Service['npcd'];
+ mode => '0644',
+ owner => root,
+ group => root,
+ notify => Service['npcd'],
+ require => [ Package['nagios'], Package['pnp4nagios'] ];
}
service { 'npcd':
@@ -56,9 +58,10 @@ class nagios::pnp4nagios {
path => '/usr/share/nagios3/htdocs/images/action.gif',
source => [ 'puppet:///modules/site_nagios/pnp4nagios/action.gif',
'puppet:///modules/nagios/pnp4nagios/action.gif' ],
- mode => '0644',
- owner => root,
- group => root,
- notify => Service['nagios'];
+ mode => '0644',
+ owner => root,
+ group => root,
+ notify => Service['nagios'],
+ require => Package['nagios'];
}
}