summaryrefslogtreecommitdiff
path: root/manifests/client
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/client')
-rw-r--r--manifests/client/base.pp1
-rw-r--r--manifests/client/darwin.pp1
-rw-r--r--manifests/client/debian.pp1
-rw-r--r--manifests/client/gentoo.pp1
-rw-r--r--manifests/client/openbsd.pp52
-rw-r--r--manifests/client/package.pp20
6 files changed, 54 insertions, 22 deletions
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 17387e8..7c2adc2 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,4 +1,5 @@
class munin::client::base {
+
service { 'munin-node':
ensure => running,
enable => true,
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
index 369a605..9cfe7e9 100644
--- a/manifests/client/darwin.pp
+++ b/manifests/client/darwin.pp
@@ -1,4 +1,5 @@
class munin::client::darwin {
+
file { "/usr/share/snmp/snmpd.conf":
mode => 744,
content => template("munin/darwin_snmpd.conf.erb"),
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index 97f5fbf..7c56788 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -1,4 +1,5 @@
class munin::client::debian inherits munin::client::package {
+
# the plugin will need that
package { "iproute": ensure => installed }
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index c24d317..d4fe71e 100644
--- a/manifests/client/gentoo.pp
+++ b/manifests/client/gentoo.pp
@@ -1,4 +1,5 @@
class munin::client::gentoo inherits munin::client::package {
+
Package['munin-node'] {
name => 'munin',
category => 'net-analyzer',
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index c10a474..1f6248d 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -1,39 +1,57 @@
# 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;
- }
- package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser',
- 'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined',
- 'p5-Net-SSLeay', 'p5-Net-Server', 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]:
- ensure => installed,
- before => File['/var/run/munin'],
- }
- exec{'extract_openbsd':
+ }
+ 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 => File['/var/run/munin'],
+ }
+ package{'p5-Compress-Zlib':
+ ensure => installed,
+ before => File['/var/run/munin'],
+ }
+ } else {
+ package{'munin-node':
+ ensure => installed,
+ }
+ }
+ package{ [ 'p5-Crypt-SSLeay', 'p5-HTML-Parser', 'p5-HTML-Tagset', 'p5-HTTP-GHTTP',
+ 'p5-LWP-UserAgent-Determined', 'p5-Net-SSLeay', 'p5-Net-Server',
+ 'p5-URI', 'p5-libwww', 'pcre', 'curl' ]:
+ ensure => installed,
+ before => File['/var/run/munin'],
}
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',
- hasstatus => false,
- hasrestart => false,
+ start => $operatingsystemrelease ? {
+ '4.3' => '/opt/munin/sbin/munin-node',
+ default => '/usr/local/sbin/munin-node'
+ },
+ status => 'test -e /var/run/munin/munin-node.pid && (ps ax | egrep -q "^$(cat /var/run/munin/munin-node.pid).*munin-node")',
+ hasstatus => true,
+ hasrestart => true,
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/client/package.pp b/manifests/client/package.pp
index 18566b8..0ee7443 100644
--- a/manifests/client/package.pp
+++ b/manifests/client/package.pp
@@ -1,11 +1,21 @@
class munin::client::package inherits munin::client::base {
- package { 'munin-node': ensure => installed }
+
+ if $munin_node_ensure_version == '' { $munin_node_ensure_version = 'installed' }
+
+ if $operatingsystem == "Debian" and $lsbdistcodename != "lenny" {
+ package { 'munin-common':
+ before => Package['munin-node'],
+ ensure => $munin_node_ensure_version;
+ }
+
+ package { 'munin-node': ensure => $munin_node_ensure_version }
Service['munin-node']{
- require => Package[munin-node],
+ require => Package[munin-node],
}
File['/etc/munin/munin-node.conf']{
- # this has to be installed before the package, so the postinst can
- # boot the munin-node without failure!
- before => Package['munin-node'],
+ # this has to be installed before the package, so the postinst can
+ # boot the munin-node without failure!
+ before => Package['munin-node'],
}
+ }
}