From 74f66a8e77b153552ef52efee03187320e1ce877 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 10 Dec 2010 16:48:01 -0500 Subject: standardize formatting --- manifests/client/base.pp | 10 ++++-- manifests/client/darwin.pp | 44 +++++++++++++----------- manifests/client/debian.pp | 4 ++- manifests/client/gentoo.pp | 8 +++-- manifests/client/openbsd.pp | 83 ++++++++++++++++++++++++--------------------- manifests/client/package.pp | 1 + 6 files changed, 87 insertions(+), 63 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/base.pp b/manifests/client/base.pp index b834e9b..0f0feca 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -1,23 +1,29 @@ class munin::client::base { + service { 'munin-node': ensure => running, enable => true, hasstatus => true, hasrestart => true, } - file {'/etc/munin': + + 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': + + 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/darwin.pp b/manifests/client/darwin.pp index f6fc95f..5ae5b60 100644 --- a/manifests/client/darwin.pp +++ b/manifests/client/darwin.pp @@ -1,21 +1,27 @@ 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 bd0fad5..e75f484 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -1,13 +1,15 @@ class munin::client::debian inherits munin::client::package { + # the plugin will need that if !defined(Package["iproute"]) { 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"), } diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp index 53d472b..e651134 100644 --- a/manifests/client/gentoo.pp +++ b/manifests/client/gentoo.pp @@ -1,8 +1,10 @@ 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 90bf7df..468cffa 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -1,43 +1,50 @@ # 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/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, - } + 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, + } } diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 921d996..f6e7a08 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -25,4 +25,5 @@ class munin::client::package inherits munin::client::base { # boot the munin-node without failure! before => Package['munin-node'], } + } -- cgit v1.2.3