diff options
author | Micah <micah@riseup.net> | 2015-05-07 14:54:05 +0000 |
---|---|---|
committer | Micah <micah@riseup.net> | 2015-05-07 14:54:05 +0000 |
commit | 2bbe7aae540d987303a352c9e3148da58f04076d (patch) | |
tree | ca9d9c21ff0bfc77f94ae05220696b9b371bf667 /manifests/base.pp | |
parent | c476d34e348fdb2fa77458d60432e5cd92e9a3be (diff) | |
parent | f2e75a6e5143ad794275ee7c1c14577d787095cb (diff) |
Merge branch 'manage_resource.cfg' into 'master'
Only use the private directory on CentOS
Debian and ubuntu have their resource.cfg file placed in /etc/nagios3/
and when it's absent it can cause issues with the package (because the
package is badly done).
This is a followup to issue https://labs.riseup.net/code/issues/4240
See merge request !4
Diffstat (limited to 'manifests/base.pp')
-rw-r--r-- | manifests/base.pp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 0f8b777..8f99564 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -44,17 +44,26 @@ class nagios::base { mode => 0640, owner => root, group => apache; } - file { 'nagios_private': - path => "${nagios::defaults::vars::int_cfgdir}/private/", - ensure => directory, - purge => true, - recurse => true, - notify => Service['nagios'], - mode => '0750', owner => root, group => nagios; + if $::operatingsystem == 'Centos' { + file { 'nagios_private': + ensure => directory, + path => "${nagios::defaults::vars::int_cfgdir}/private/", + purge => true, + recurse => true, + mode => '0750', + owner => 'root', + group => 'nagios', + notify => Service['nagios'], + } + + $resource_cfg_dir = "${nagios::defaults::vars::int_cfgdir}/private" + } + else { + $resource_cfg_dir = $nagios::defaults::vars::int_cfgdir } file { 'nagios_private_resource_cfg': - path => "${nagios::defaults::vars::int_cfgdir}/private/resource.cfg", + path => "${resource_cfg_dir}/resource.cfg", source => [ "puppet:///modules/site_nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", "puppet:///modules/nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}" ], notify => Service['nagios'], |