summaryrefslogtreecommitdiff
path: root/manifests/client
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-09-29 22:51:15 +0200
committermh <mh@immerda.ch>2009-09-29 22:51:15 +0200
commit1893960c1babb6a261cc6fc399231e9c0644a104 (patch)
tree7e4fb1f3d2d34490b8d5cfff50d6f9cadf890fb9 /manifests/client
parentc63a28d3c16ec2bb3a46d3d5faf6d7ef3b737b70 (diff)
refactor everything into its own file
Diffstat (limited to 'manifests/client')
-rw-r--r--manifests/client/base.pp23
-rw-r--r--manifests/client/centos.pp3
-rw-r--r--manifests/client/darwin.pp21
-rw-r--r--manifests/client/debian.pp15
-rw-r--r--manifests/client/gentoo.pp9
-rw-r--r--manifests/client/openbsd.pp43
-rw-r--r--manifests/client/package.pp11
7 files changed, 125 insertions, 0 deletions
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
new file mode 100644
index 0000000..1f72e7e
--- /dev/null
+++ b/manifests/client/base.pp
@@ -0,0 +1,23 @@
+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
+}
diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp
new file mode 100644
index 0000000..46a7e3f
--- /dev/null
+++ b/manifests/client/centos.pp
@@ -0,0 +1,3 @@
+class munin::client::centos inherits munin::client::package {
+ include munin::plugins::centos
+}
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
new file mode 100644
index 0000000..f6fc95f
--- /dev/null
+++ b/manifests/client/darwin.pp
@@ -0,0 +1,21 @@
+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: }
+}
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
new file mode 100644
index 0000000..a6d677e
--- /dev/null
+++ b/manifests/client/debian.pp
@@ -0,0 +1,15 @@
+class munin::client::debian inherits munin::client::package {
+ # 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
+}
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
new file mode 100644
index 0000000..761742e
--- /dev/null
+++ b/manifests/client/gentoo.pp
@@ -0,0 +1,9 @@
+class munin::client::gentoo inherits munin::client::package {
+ Package['munin-node'] {
+ name => 'munin',
+ category => 'net-analyzer',
+ }
+
+
+ include munin::plugins::gentoo
+}
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
new file mode 100644
index 0000000..303acd7
--- /dev/null
+++ b/manifests/client/openbsd.pp
@@ -0,0 +1,43 @@
+# currently we install munin on openbsd by targz
+# :(
+class munin::client::openbsd inherits munin::client::base {
+ file{'/usr/src/munin_openbsd.tar.gz':
+ source => "puppet://$server/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::add_to_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,
+ }
+}
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
new file mode 100644
index 0000000..84fcf5c
--- /dev/null
+++ b/manifests/client/package.pp
@@ -0,0 +1,11 @@
+class munin::client::package inherits munin::client::base {
+ package { 'munin-node': ensure => installed }
+ 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'],
+ }
+}