diff options
author | Gabriel Filion <gabriel@koumbit.org> | 2011-02-01 16:21:20 -0500 |
---|---|---|
committer | Gabriel Filion <lelutin@gmail.com> | 2012-04-09 23:49:18 -0400 |
commit | c9de09ece4508db6b216abd0f74f07ea7befe906 (patch) | |
tree | 81a47fe542a2ba04ea4cae8bc377ae951ee2b139 | |
parent | f9f47f1e2af2d7bd4b60c84697fcffe365b1d0dd (diff) |
nrpe FreeBSD compatibility
Make some changes to ensure compatibility of the nrpe resources with
FreeBSD.
* Use group 0 instead of 'root'
* capitalize values for testing $operatingsystem
* override arguments for the nrpe service so that FreeBSD can find the
init script
-rw-r--r-- | manifests/nrpe.pp | 2 | ||||
-rw-r--r-- | manifests/nrpe/base.pp | 2 | ||||
-rw-r--r-- | manifests/nrpe/command.pp | 8 | ||||
-rw-r--r-- | manifests/nrpe/freebsd.pp | 5 |
4 files changed, 8 insertions, 9 deletions
diff --git a/manifests/nrpe.pp b/manifests/nrpe.pp index fe75708..c9ecf75 100644 --- a/manifests/nrpe.pp +++ b/manifests/nrpe.pp @@ -1,7 +1,7 @@ class nagios::nrpe { case $operatingsystem { - 'freebsd': { + 'FreeBSD': { if $nagios_nrpe_cfgdir == '' { $nagios_nrpe_cfgdir = '/usr/local/etc' } include nagios::nrpe::freebsd diff --git a/manifests/nrpe/base.pp b/manifests/nrpe/base.pp index 6e39d7e..d96dc3f 100644 --- a/manifests/nrpe/base.pp +++ b/manifests/nrpe/base.pp @@ -15,7 +15,7 @@ class nagios::nrpe::base { file { "$nagios_nrpe_cfgdir/nrpe.cfg": content => template('nagios/nrpe/nrpe.cfg'), - owner => root, group => root, mode => 644; + owner => root, group => 0, mode => 644; } # default commands diff --git a/manifests/nrpe/command.pp b/manifests/nrpe/command.pp index 9c90ed7..e6ebdae 100644 --- a/manifests/nrpe/command.pp +++ b/manifests/nrpe/command.pp @@ -13,17 +13,11 @@ define nagios::nrpe::command ( file { "$nagios_nrpe_cfgdir/nrpe.d/${name}_command.cfg": ensure => $ensure, - mode => 644, owner => root, group => root, + mode => 644, owner => root, group => 0, notify => Service['nagios-nrpe-server'], require => File [ "$nagios_nrpe_cfgdir/nrpe.d" ] } - if $operatingsystem == 'freebsd' { - File["$nagios_nrpe_cfgdir/nrpe.d/${name}_command.cfg"] { - group => wheel, - } - } - case $source { '': { File["$nagios_nrpe_cfgdir/nrpe.d/${name}_command.cfg"] { diff --git a/manifests/nrpe/freebsd.pp b/manifests/nrpe/freebsd.pp index 3e1e0e1..73e7687 100644 --- a/manifests/nrpe/freebsd.pp +++ b/manifests/nrpe/freebsd.pp @@ -7,4 +7,9 @@ class nagios::nrpe::freebsd inherits nagios::nrpe::base { # TODO check_cpustats.sh is probably not working as of now. the package 'sysstat' is not available under FreeBSD + Service["nagios-nrpe-server"] { + pattern => undef, + path => "/usr/local/etc/rc.d", + name => "nrpe2", + } } |