summaryrefslogtreecommitdiff
path: root/manifests/plugin.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2008-10-01 19:54:20 +0000
committermh <mh@immerda.ch>2008-10-01 19:54:20 +0000
commit14c511f7f6791f56952bc312e5ff8cf4826bb14e (patch)
treec0d922a6b39c53f11e6a40485dfd5119eb1e1eab /manifests/plugin.pp
parentb0c793fefc5f1fcfc3f4ac646803bb8aedfbc5d9 (diff)
tried to make munin-node installable and runable on openbsd
Diffstat (limited to 'manifests/plugin.pp')
-rw-r--r--manifests/plugin.pp57
1 files changed, 38 insertions, 19 deletions
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index 741de30..4395cef 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -8,18 +8,11 @@
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"
- }
- 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 = "/opt/munin/lib/plugins/" }
+ default: { $script_path = "/usr/share/munin/plugins" }
}
}
@@ -45,10 +38,14 @@ define munin::plugin (
}
default: {
debug ( "munin_plugin: making $plugin using src: $plugin_src" )
+ case $kernel {
+ openbsd: { $basic_require = File['/var/run/munin'] }
+ default: { $basic_require = Package['munin-node'] }
+ }
if $require {
- $real_require = [ $require, Package['munin-node'] ]
+ $real_require = [ $require, $basic_require ]
} else {
- $real_require = Package['munin-node']
+ $real_require = $basic_require
}
file { $plugin:
ensure => "${real_script_path}/${plugin_src}",
@@ -118,13 +115,24 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') {
file { "munin_plugin_${name}":
path => "$munin::plugin::scriptpaths::script_path/${name}",
source => "puppet://$server/$real_source",
- require => Package['munin-node'],
mode => 0755, owner => root, group => 0;
}
+
+ case $kernel {
+ openbsd: { $basic_require = File['/var/run/munin'] }
+ default: { $basic_require = Package['munin-node'] }
+ }
if $require {
File["munin_plugin_${name}"]{
- require +> $require,
+ require => [ $basic_require, $require ],
+ }
+ } else {
+ File["munin_plugin_${name}"]{
+ require => $basic_require,
}
+ }
+ # register the plugin
+ if $require {
munin::plugin{$name: ensure => $ensure, config => $config, require => $require }
} else {
munin::plugin{$name: ensure => $ensure, config => $config }
@@ -135,20 +143,31 @@ define munin::plugin::deploy ($source = '', $ensure = 'present', $config = '') {
class munin::plugins::base {
file {
- [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]:
+ [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
source => "puppet://$server/common/empty",
ignore => '\.ignore',
ensure => directory, checksum => mtime,
recurse => true, purge => true, force => true,
mode => 0755, owner => root, group => 0,
notify => Service['munin-node'];
- "/etc/munin/plugin-conf.d/munin-node":
+ '/etc/munin/plugin-conf.d/munin-node':
ensure => present,
mode => 0644, owner => root, group => 0,
notify => Service['munin-node'],
- before => Package['munin-node'];
}
case $kernel {
+ openbsd: {
+ File['/etc/munin/plugin-conf.d/munin-node']{
+ before => File['/var/run/munin'],
+ }
+ }
+ default: {
+ File['/etc/munin/plugin-conf.d/munin-node']{
+ before => Package['munin-node'],
+ }
+ }
+ }
+ case $kernel {
linux: {
case $vserver {
guest: { include munin::plugins::vserver }