summaryrefslogtreecommitdiff
path: root/manifests/base.pp
diff options
context:
space:
mode:
authorGabriel Filion <gabster@lelutin.ca>2015-04-19 15:18:46 -0400
committerGabriel Filion <gabster@lelutin.ca>2015-04-19 15:18:46 -0400
commitf2e75a6e5143ad794275ee7c1c14577d787095cb (patch)
tree64cc021d0501d86933a77e28dcaad07c729ec85b /manifests/base.pp
parent0b20e1e0fd001cb0b688c6bf6971c8e7c3f743c6 (diff)
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).
Diffstat (limited to 'manifests/base.pp')
-rw-r--r--manifests/base.pp25
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'],