summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-05-22 15:40:02 +0200
committermh <mh@immerda.ch>2010-05-22 15:40:02 +0200
commit95bae141ccac45f2658576c87e25af24c265cf97 (patch)
tree5c3ca9c1c2924aded00ca50a8e67b0e3dc4b58af
parenteef1345dd22c54b593966d0bede2d16747f01aa7 (diff)
for new openbsd releases we can finally use a package
-rw-r--r--manifests/client/openbsd.pp35
-rw-r--r--manifests/plugin/scriptpaths.pp13
2 files changed, 31 insertions, 17 deletions
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 90bf7df..2132f05 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,9 +1,21 @@
# currently we install munin on openbsd by targz
# :(
class munin::client::openbsd inherits munin::client::base {
- file{'/usr/src/munin_openbsd.tar.gz':
+ if $operatingsystemrelease == '4.3' {
+ file{'/usr/src/munin_openbsd.tar.gz':
source => "puppet://$server/modules/munin/openbsd/package/munin_openbsd.tar.gz",
owner => root, group => 0, mode => 0600;
+ }
+ exec{'extract_openbsd':
+ command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz',
+ unless => 'test -d /opt/munin',
+ require => File['/usr/src/munin_openbsd.tar.gz'],
+ before => Exec['extract_openbsd'],
+ }
+ } else {
+ package{'munin-node':
+ ensure => installed,
+ }
}
package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser',
'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined',
@@ -11,29 +23,28 @@ class munin::client::openbsd inherits munin::client::base {
ensure => installed,
before => File['/var/run/munin'],
}
- exec{'extract_openbsd':
- command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz',
- unless => 'test -d /opt/munin',
- require => File['/usr/src/munin_openbsd.tar.gz'],
- }
file{[ '/var/run/munin', '/var/log/munin' ]:
- ensure => directory,
- require => Exec['extract_openbsd'],
- owner => root, group => 0, mode => 0755;
+ ensure => directory,
+ owner => root, group => 0, mode => 0755;
}
openbsd::rc_local{'munin-node':
- binary => '/opt/munin/sbin/munin-node',
+ binary => $operatingsystemrelease ? {
+ '4.3' => '/opt/munin/sbin/munin-node',
+ default => '/usr/local/sbin/munin-node'
+ },
require => File['/var/run/munin'],
}
Service['munin-node']{
restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`',
stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`',
- start => '/opt/munin/sbin/munin-node',
+ start => $operatingsystemrelease ? {
+ '4.3' => '/opt/munin/sbin/munin-node',
+ default => '/usr/local/sbin/munin-node'
+ },
hasstatus => false,
hasrestart => false,
require => [ File['/var/run/munin'], File['/var/log/munin'] ],
}
-
cron{'clean_munin_logfile':
command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`',
minute => 0,
diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp
index ebaa6fa..115644c 100644
--- a/manifests/plugin/scriptpaths.pp
+++ b/manifests/plugin/scriptpaths.pp
@@ -1,9 +1,12 @@
class munin::plugin::scriptpaths {
case $operatingsystem {
- gentoo: { $script_path = "/usr/libexec/munin/plugins" }
- debian: { $script_path = "/usr/share/munin/plugins" }
- centos: { $script_path = "/usr/share/munin/plugins" }
- openbsd: { $script_path = "/opt/munin/lib/plugins/" }
- default: { $script_path = "/usr/share/munin/plugins" }
+ gentoo: { $script_path = '/usr/libexec/munin/plugins' }
+ debian: { $script_path = '/usr/share/munin/plugins' }
+ centos: { $script_path = '/usr/share/munin/plugins' }
+ openbsd: { $script_path = $operatingsystemrelease ? {
+ '4.3' => '/opt/munin/lib/plugins/',
+ default => '/usr/local/libexec/munin/plugins/'
+ } }
+ default: { $script_path = '/usr/share/munin/plugins' }
}
}