From 4591a91f7a8b169d0aa3ccb46357c60f8dcb7079 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Thu, 13 May 2010 14:12:07 -0400 Subject: remove tabs and trailing whitespaces in manifests --- manifests/client/base.pp | 12 ++++++------ manifests/client/centos.pp | 2 +- manifests/client/darwin.pp | 38 +++++++++++++++++++------------------- manifests/client/debian.pp | 18 +++++++++--------- manifests/client/gentoo.pp | 4 ++-- manifests/client/openbsd.pp | 2 +- manifests/client/package.pp | 8 ++++---- 7 files changed, 42 insertions(+), 42 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/base.pp b/manifests/client/base.pp index b3fcc4a..afa12a0 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -1,6 +1,6 @@ class munin::client::base { service { 'munin-node': - ensure => running, + ensure => running, enable => true, hasstatus => true, hasrestart => true, @@ -14,10 +14,10 @@ class munin::client::base { default => $munin_allow } file {'/etc/munin/munin-node.conf': - content => template("munin/munin-node.conf.$operatingsystem"), + content => template("munin/munin-node.conf.$operatingsystem"), notify => Service['munin-node'], - mode => 0644, owner => root, group => 0, - } - munin::register { $fqdn: } - include munin::plugins::base + 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 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 f6fc95f..369a605 100644 --- a/manifests/client/darwin.pp +++ b/manifests/client/darwin.pp @@ -1,21 +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: } + 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 a6d677e..97f5fbf 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -1,15 +1,15 @@ class munin::client::debian inherits munin::client::package { # the plugin will need that - package { "iproute": ensure => installed } + package { "iproute": ensure => installed } - Service["munin-node"]{ - # sarge's munin-node init script has no status - hasstatus => $lsbdistcodename ? { sarge => false, default => true } - } + 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"), + content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } - # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } - include munin::plugins::debian + # 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 53d472b..c24d317 100644 --- a/manifests/client/gentoo.pp +++ b/manifests/client/gentoo.pp @@ -3,6 +3,6 @@ class munin::client::gentoo inherits munin::client::package { 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..c10a474 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -5,7 +5,7 @@ class munin::client::openbsd inherits munin::client::base { 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', + 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, diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 84fcf5c..18566b8 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,11 +1,11 @@ class munin::client::package inherits munin::client::base { - package { 'munin-node': ensure => installed } + 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'], + # this has to be installed before the package, so the postinst can + # boot the munin-node without failure! + before => Package['munin-node'], } } -- cgit v1.2.3 From f1586a7fbcc79fee6542790b1f4c930929af7e04 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 14 May 2010 11:02:03 -0400 Subject: refactor register class and client template --- manifests/client/base.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/base.pp b/manifests/client/base.pp index afa12a0..17387e8 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -18,6 +18,8 @@ class munin::client::base { notify => Service['munin-node'], mode => 0644, owner => root, group => 0, } - munin::register { $fqdn: } + munin::register { $fqdn: + config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'], + } include munin::plugins::base } -- cgit v1.2.3 From 95bae141ccac45f2658576c87e25af24c265cf97 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 22 May 2010 15:40:02 +0200 Subject: for new openbsd releases we can finally use a package --- manifests/client/openbsd.pp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 90bf7df..2132f05 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -1,9 +1,21 @@ # 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; + } + 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 => Exec['extract_openbsd'], + } + } else { + package{'munin-node': + ensure => installed, + } } package{ [ 'p5-Compress-Zlib', 'p5-Crypt-SSLeay', 'p5-HTML-Parser', 'p5-HTML-Tagset', 'p5-HTTP-GHTTP', 'p5-LWP-UserAgent-Determined', @@ -11,29 +23,28 @@ class munin::client::openbsd inherits munin::client::base { 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; + 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', + start => $operatingsystemrelease ? { + '4.3' => '/opt/munin/sbin/munin-node', + default => '/usr/local/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, -- cgit v1.2.3 From 9ecc2313669ca80f30ae6a2b33308ffa062f9615 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 22 May 2010 15:51:14 +0200 Subject: this package is not anymore needed on latest openbsd --- manifests/client/openbsd.pp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 2132f05..31a9621 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -12,14 +12,18 @@ class munin::client::openbsd inherits munin::client::base { require => File['/usr/src/munin_openbsd.tar.gz'], before => Exec['extract_openbsd'], } + package{'p5-Compress-Zlib': + ensure => installed, + before => File['/var/run/munin'], + } } else { package{'munin-node': ensure => installed, } } - 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' ]: + 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'], } -- cgit v1.2.3 From 45c08416b675141f75a07bb0d918109fb0eb3581 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 22 May 2010 20:49:52 +0200 Subject: check status over pidfile --- manifests/client/openbsd.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 31a9621..3c65fbd 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -45,8 +45,9 @@ class munin::client::openbsd inherits munin::client::base { '4.3' => '/opt/munin/sbin/munin-node', default => '/usr/local/sbin/munin-node' }, - hasstatus => false, - hasrestart => false, + 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': -- cgit v1.2.3 From d63bc7ba3edc39e2fe7dbbefd87edac45176b13b Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 5 Jun 2010 12:20:24 +0200 Subject: fix dependency cycle --- manifests/client/openbsd.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp index 3c65fbd..8de025e 100644 --- a/manifests/client/openbsd.pp +++ b/manifests/client/openbsd.pp @@ -10,7 +10,7 @@ class munin::client::openbsd inherits munin::client::base { command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz', unless => 'test -d /opt/munin', require => File['/usr/src/munin_openbsd.tar.gz'], - before => Exec['extract_openbsd'], + before => File['/var/run/munin'], } package{'p5-Compress-Zlib': ensure => installed, -- cgit v1.2.3