summaryrefslogtreecommitdiff
path: root/manifests/client
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2011-03-25 00:01:54 -0400
committerMicah Anderson <micah@riseup.net>2011-03-25 00:01:54 -0400
commit5218993abef2a8bf79278d4d84123843279735c5 (patch)
tree8fe859ba86b83e4b9782ac19a37c89bf5cf5f0ba /manifests/client
parentb3e29447187e289c60a4a9f7830032f1b10fae2f (diff)
parente7d23dabf191c5416197af0b229fc90b94539405 (diff)
Merge commit 'e7d23dabf191c5416197af0b229fc90b94539405'
Conflicts: manifests/client.pp manifests/client/base.pp manifests/client/darwin.pp manifests/client/debian.pp manifests/client/gentoo.pp manifests/client/openbsd.pp manifests/client/package.pp manifests/host.pp manifests/init.pp manifests/plugin.pp manifests/plugin/scriptpaths.pp manifests/plugins/interfaces.pp manifests/plugins/linux.pp manifests/plugins/vserver.pp manifests/register.pp manifests/register_snmp.pp manifests/remoteplugin.pp manifests/snmp_collector.pp
Diffstat (limited to 'manifests/client')
-rw-r--r--manifests/client/base.pp49
-rw-r--r--manifests/client/centos.pp2
-rw-r--r--manifests/client/darwin.pp43
-rw-r--r--manifests/client/debian.pp26
-rw-r--r--manifests/client/gentoo.pp5
-rw-r--r--manifests/client/openbsd.pp99
-rw-r--r--manifests/client/package.pp24
7 files changed, 119 insertions, 129 deletions
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 0f0feca..7c2adc2 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,29 +1,26 @@
class munin::client::base {
- service { 'munin-node':
- ensure => running,
- enable => true,
- hasstatus => true,
- hasrestart => true,
- }
-
- file { '/etc/munin':
- ensure => directory,
- mode => 0755, owner => root, group => 0;
- }
-
- $real_munin_allow = $munin_allow ? {
- '' => '127.0.0.1',
- default => $munin_allow
- }
-
- file { '/etc/munin/munin-node.conf':
- content => template("munin/munin-node.conf.$operatingsystem"),
- notify => Service['munin-node'],
- mode => 0644, owner => root, group => 0,
- }
-
- munin::register { $fqdn: }
- include munin::plugins::base
-
+ service { 'munin-node':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ hasrestart => true,
+ }
+ file {'/etc/munin':
+ ensure => directory,
+ mode => 0755, owner => root, group => 0;
+ }
+ $real_munin_allow = $munin_allow ? {
+ '' => '127.0.0.1',
+ default => $munin_allow
+ }
+ file {'/etc/munin/munin-node.conf':
+ content => template("munin/munin-node.conf.$operatingsystem"),
+ notify => Service['munin-node'],
+ mode => 0644, owner => root, group => 0,
+ }
+ munin::register { $fqdn:
+ config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
+ }
+ include munin::plugins::base
}
diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp
index 46a7e3f..42e8c59 100644
--- a/manifests/client/centos.pp
+++ b/manifests/client/centos.pp
@@ -1,3 +1,3 @@
class munin::client::centos inherits munin::client::package {
- include munin::plugins::centos
+ include munin::plugins::centos
}
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
index 5ae5b60..9cfe7e9 100644
--- a/manifests/client/darwin.pp
+++ b/manifests/client/darwin.pp
@@ -1,27 +1,22 @@
class munin::client::darwin {
- file { '/usr/share/snmp/snmpd.conf':
- mode => 744,
- content => template("munin/darwin_snmpd.conf.erb"),
- group => 0,
- owner => root,
- }
-
- delete_matching_line{"startsnmpdno":
- file => "/etc/hostconfig",
- pattern => "SNMPSERVER=-NO-",
- }
-
- line { "startsnmpdyes":
- file => "/etc/hostconfig",
- line => "SNMPSERVER=-YES-",
- notify => Exec["/sbin/SystemStarter start SNMP"],
- }
-
- exec{"/sbin/SystemStarter start SNMP":
- noop => false,
- }
-
- munin::register_snmp { $fqdn: }
-
+ file { "/usr/share/snmp/snmpd.conf":
+ mode => 744,
+ content => template("munin/darwin_snmpd.conf.erb"),
+ group => 0,
+ owner => root,
+ }
+ delete_matching_line{"startsnmpdno":
+ file => "/etc/hostconfig",
+ pattern => "SNMPSERVER=-NO-",
+ }
+ line { "startsnmpdyes":
+ file => "/etc/hostconfig",
+ line => "SNMPSERVER=-YES-",
+ notify => Exec["/sbin/SystemStarter start SNMP"],
+ }
+ exec{"/sbin/SystemStarter start SNMP":
+ noop => false,
+ }
+ munin::register_snmp { $fqdn: }
}
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index e75f484..7c56788 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -1,20 +1,16 @@
class munin::client::debian inherits munin::client::package {
- # the plugin will need that
- if !defined(Package["iproute"]) {
+ # the plugin will need that
package { "iproute": ensure => installed }
- }
-
- Service["munin-node"]{
- # sarge's munin-node init script has no status
- hasstatus => $lsbdistcodename ? { sarge => false, default => true }
- }
-
- File["/etc/munin/munin-node.conf"]{
- content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"),
- }
- # workaround bug in munin_node_configure
- plugin { "postfix_mailvolume": ensure => absent }
- include munin::plugins::debian
+ Service["munin-node"]{
+ # sarge's munin-node init script has no status
+ hasstatus => $lsbdistcodename ? { sarge => false, default => true }
+ }
+ File["/etc/munin/munin-node.conf"]{
+ content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"),
+ }
+ # workaround bug in munin_node_configure
+ plugin { "postfix_mailvolume": ensure => absent }
+ include munin::plugins::debian
}
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index e651134..d4fe71e 100644
--- a/manifests/client/gentoo.pp
+++ b/manifests/client/gentoo.pp
@@ -3,8 +3,7 @@ class munin::client::gentoo inherits munin::client::package {
Package['munin-node'] {
name => 'munin',
category => 'net-analyzer',
- }
+ }
- include munin::plugins::gentoo
-
+ include munin::plugins::gentoo
}
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 468cffa..1f6248d 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -3,48 +3,59 @@
class munin::client::openbsd inherits munin::client::base {
- 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':
- 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;
- }
-
- openbsd::rc_local{ 'munin-node':
- binary => '/opt/munin/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,
- 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,
- hour => 2,
- weekday => 0,
- }
+ 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 => 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,
+ owner => root, group => 0, mode => 0755;
+ }
+ openbsd::rc_local{'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 => $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,
+ hour => 2,
+ weekday => 0,
+ }
}
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
index f6e7a08..0ee7443 100644
--- a/manifests/client/package.pp
+++ b/manifests/client/package.pp
@@ -8,22 +8,14 @@ class munin::client::package inherits munin::client::base {
ensure => $munin_node_ensure_version;
}
- Package['munin-node']{
- require => Package['munin-common'],
+ package { 'munin-node': ensure => $munin_node_ensure_version }
+ Service['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'],
}
}
-
-
- package { 'munin-node': ensure => $munin_node_ensure_version }
-
- Service['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'],
- }
-
}