Added support for OpenBSD nodes to munin module.

This commit is contained in:
Ossi Salmi 2009-09-11 19:59:35 +03:00 committed by Timo Mkinen
parent bd08225527
commit 1d260a4997
2 changed files with 70 additions and 18 deletions

View file

@ -13,11 +13,24 @@ class munin::node {
require => Package["munin-node"],
}
case $operatingsystem {
OpenBSD: {
Service["munin-node"] {
name => "munin-node",
binary => "/usr/local/sbin/munin-node",
start => "/usr/local/sbin/munin-node",
}
}
}
file { "/etc/munin/munin-node.conf":
ensure => present,
content => template("munin/munin-node.conf.erb"),
owner => root,
group => root,
group => $operatingsystem ? {
OpenBSD => wheel,
default => root,
},
mode => 0644,
require => Package["munin-node"],
notify => Service["munin-node"],
@ -62,13 +75,27 @@ class munin::node {
#
define munin::plugin($config = "") {
file { "/usr/share/munin/plugins/${name}":
ensure => present,
source => "puppet:///munin/plugins/${name}",
owner => root,
group => root,
mode => 0755,
require => Package["munin-node"],
case $operatingsystem {
OpenBSD: {
file { "/usr/local/lib/munin/plugins/${name}":
ensure => present,
source => "puppet:///munin/plugins/${name}",
owner => root,
group => wheel,
mode => 0755,
require => Package["munin-node"],
}
}
default: {
file { "/usr/share/munin/plugins/${name}":
ensure => present,
source => "puppet:///munin/plugins/${name}",
owner => root,
group => root,
mode => 0755,
require => Package["munin-node"],
}
}
}
if ($config) {
@ -78,21 +105,42 @@ define munin::plugin($config = "") {
"puppet:///files/munin/plugin-conf/${config}",
"puppet:///munin/plugin-conf/${config}", ],
owner => root,
group => root,
group => $operatingsystem ? {
OpenBSD => wheel,
default => root,
},
mode => 0644,
notify => Service["munin-node"],
require => File["/usr/share/munin/plugins/${name}"],
require => $operatingsystem ? {
OpenBSD => File["/usr/local/lib/munin/plugins/${name}"],
default => File["/usr/share/munin/plugins/${name}"],
},
}
}
exec { "munin-enable-${name}":
command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root,
onlyif => [ "! test -h /etc/munin/plugins/${name}",
"/usr/share/munin/plugins/${name} autoconf", ],
notify => Service["munin-node"],
require => File["/usr/share/munin/plugins/${name}"],
case $operatingsystem {
OpenBSD: {
exec { "munin-enable-${name}":
command => "ln -s /usr/local/lib/munin/plugins/${name} /etc/munin/plugins/${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root,
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
"/usr/local/lib/munin/plugins/${name} autoconf", ],
notify => Service["munin-node"],
require => File["/usr/local/lib/munin/plugins/${name}"],
}
}
default: {
exec { "munin-enable-${name}":
command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
user => root,
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
"/usr/share/munin/plugins/${name} autoconf", ],
notify => Service["munin-node"],
require => File["/usr/share/munin/plugins/${name}"],
}
}
}
}

View file

@ -10,7 +10,11 @@ background 1
setseid 1
user root
<% if operatingsystem == "OpenBSD" -%>
group wheel
<% else -%>
group root
<% end -%>
setsid yes
# Regexps for files to ignore