From ebfde169e0ef4fc749cd6804e707103fab7dbf78 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 19:50:28 -0500 Subject: take out the removal of the postfix_mailvolume munin plugin. I do not see what the bug is, and this interferes with local installation of the plugin (causes duplicate definitions) --- manifests/client/debian.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index a6d677e..7b8b5a7 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -9,7 +9,5 @@ class munin::client::debian inherits munin::client::package { 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 } -- cgit v1.2.3 From 511afffde2c5375fd685133f6c697c3ffeaaed8b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 19:59:02 -0500 Subject: indentation fixups, using the emacs/vim modes for standardization --- manifests/client/debian.pp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index 7b8b5a7..0bc0414 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -1,13 +1,13 @@ 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"), - } - include munin::plugins::debian + # 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"), + } + include munin::plugins::debian } -- cgit v1.2.3 From ed86ae3ba62c53f480047ac8dd0488ef84878fa2 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:00:51 -0500 Subject: we may have iproute installed elsewhere, by doing it in the munin module, we risk duplicate definitions. this commit fixes that by doing a check to see if it is already defined elsewhere, and if it is not, then it installs the package --- manifests/client/debian.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index 0bc0414..8dfa35f 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -1,6 +1,8 @@ class munin::client::debian inherits munin::client::package { # the plugin will need that - package { "iproute": ensure => installed } + if !defined(Package["iproute"]) { + package { "iproute": ensure => installed } + } Service["munin-node"]{ # sarge's munin-node init script has no status -- cgit v1.2.3 From f868f9fbb4ab6eae2a49212cd7734bda455e812d Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:17:16 -0500 Subject: Revert "take out the removal of the postfix_mailvolume munin plugin. I do not see what the bug is, and this interferes with local installation of the plugin (causes duplicate definitions)" It looks like the reason this is here is because on a default debian install, without postfix installed, this postfix munin module is activated, leading to empty graphs. So rather that leave non-postfix people in this situation, we can instead leave this in and the class can be overridden locally. This reverts commit ebfde169e0ef4fc749cd6804e707103fab7dbf78. Conflicts: manifests/client/debian.pp --- manifests/client/debian.pp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'manifests/client') diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index 8dfa35f..f7df8d5 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -12,4 +12,8 @@ class munin::client::debian inherits munin::client::package { content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } include munin::plugins::debian + + # workaround bug in munin_node_configure + plugin { "postfix_mailvolume": ensure => absent } + include munin::plugins::debian } -- cgit v1.2.3 From d4df3117855d985402106e4104b87b6cb73a05c1 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:55:27 -0500 Subject: remove duplicated include of plugins --- manifests/client/debian.pp | 1 - 1 file changed, 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp index f7df8d5..bd0fad5 100644 --- a/manifests/client/debian.pp +++ b/manifests/client/debian.pp @@ -11,7 +11,6 @@ class munin::client::debian inherits munin::client::package { File["/etc/munin/munin-node.conf"]{ content => template("munin/munin-node.conf.$operatingsystem.$lsbdistcodename"), } - include munin::plugins::debian # workaround bug in munin_node_configure plugin { "postfix_mailvolume": ensure => absent } -- cgit v1.2.3 From d53ba65913d4a312cdb1e7d980b608dc103269d7 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:56:01 -0500 Subject: formatting standardization --- manifests/client/package.pp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 84fcf5c..58f40da 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 } - 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 => 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'], + } } -- cgit v1.2.3 From 8067746d6c6efde6cc3d67177910aa96f9491652 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 21:00:14 -0500 Subject: the 'users' munin plugin seems to be a centos-specific one, so we setup a special munin::plugins::centos and include that in the proper client case statement for centos --- manifests/client/package.pp | 1 + 1 file changed, 1 insertion(+) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 58f40da..1b124d0 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -8,4 +8,5 @@ class munin::client::package inherits munin::client::base { # boot the munin-node without failure! before => Package['munin-node'], } + include munin::plugins::centos } -- cgit v1.2.3 From 68238a10e33a4fae78e81b3aa74064c973a52306 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 22:32:56 -0500 Subject: more standardization of indenting/formatting --- manifests/client/base.pp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/base.pp b/manifests/client/base.pp index b3fcc4a..b834e9b 100644 --- a/manifests/client/base.pp +++ b/manifests/client/base.pp @@ -1,23 +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 + 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 } -- cgit v1.2.3 From a6477f6edc481b7874ae8b3497343d3ad8ad805f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 23 Dec 2009 14:25:02 -0500 Subject: finish settting up splitting the centos bits --- manifests/client/package.pp | 1 - 1 file changed, 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 1b124d0..58f40da 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -8,5 +8,4 @@ class munin::client::package inherits munin::client::base { # boot the munin-node without failure! before => Package['munin-node'], } - include munin::plugins::centos } -- cgit v1.2.3 From a8d3b6af4a63724ca31eab772978a35927797b2b Mon Sep 17 00:00:00 2001 From: Matt Taggart Date: Wed, 30 Dec 2009 15:11:39 -0800 Subject: add support for setting munin and munin-node package versions --- manifests/client/package.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 58f40da..482ca4f 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,5 +1,10 @@ class munin::client::package inherits munin::client::base { - package { 'munin-node': ensure => installed } + + case $munin-node_ensure_version { + '': { $munin-node_ensure_version = "installed" } + } + + package { 'munin-node': ensure => $munin-node_ensure_version } Service['munin-node']{ require => Package[munin-node], } -- cgit v1.2.3 From da6ded035a7074306587c76e8d3b90cda6b3bdc8 Mon Sep 17 00:00:00 2001 From: Matt Taggart Date: Wed, 30 Dec 2009 15:34:40 -0800 Subject: can't use - in a variable name --- manifests/client/package.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 482ca4f..7f8a7ba 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,10 +1,10 @@ class munin::client::package inherits munin::client::base { - case $munin-node_ensure_version { - '': { $munin-node_ensure_version = "installed" } + case $munin_node_ensure_version { + '': { $munin_node_ensure_version = "installed" } } - package { 'munin-node': ensure => $munin-node_ensure_version } + package { 'munin-node': ensure => $munin_node_ensure_version } Service['munin-node']{ require => Package[munin-node], } -- cgit v1.2.3 From 022e824d8a006f1ef4e742b6af5176daecda1cd0 Mon Sep 17 00:00:00 2001 From: Matt Taggart Date: Wed, 30 Dec 2009 21:22:17 -0800 Subject: switch to correct way of checking if the variable is set --- manifests/client/package.pp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 7f8a7ba..0fc3529 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -1,8 +1,6 @@ class munin::client::package inherits munin::client::base { - case $munin_node_ensure_version { - '': { $munin_node_ensure_version = "installed" } - } + if $munin_node_ensure_version == '' { $munin_node_ensure_version = 'installed' } package { 'munin-node': ensure => $munin_node_ensure_version } Service['munin-node']{ -- cgit v1.2.3 From fefc399e7e28ec871d91089d535073c2bc705009 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 10 Dec 2010 16:35:10 -0500 Subject: this change makes sure that munin-common is installed before munin-node is installed on Debian systems that are not lenny (would be nice if we could use operators for lsbdistcode name like 'if $lsbdistcodename >> "lenny") on Debian Squeeze and later, the munin-node package requires that munin-common be installed. this would normally be handled automatically by the packaging system, but if you utilize the $munin_node_ensure_version variable to set it to the backports version, and you have backports pinned properly (as the shared-apt module does it), it will fail to install the munin-common package from backports. you would think that this change should go in the debian.pp, but that is not possible because debian.pp inherits client/package.pp and thus the order happens wrong --- manifests/client/package.pp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 0fc3529..921d996 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -2,10 +2,24 @@ class munin::client::package inherits munin::client::base { 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']{ + 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! -- cgit v1.2.3 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 From a08b5db5d00980233fc5fea21e292f3b433119a0 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 25 Mar 2011 12:07:08 -0400 Subject: fix syntax error as a result of the merge --- manifests/client/package.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/client') diff --git a/manifests/client/package.pp b/manifests/client/package.pp index 0ee7443..29f256d 100644 --- a/manifests/client/package.pp +++ b/manifests/client/package.pp @@ -7,7 +7,7 @@ class munin::client::package inherits munin::client::base { before => Package['munin-node'], ensure => $munin_node_ensure_version; } - + } package { 'munin-node': ensure => $munin_node_ensure_version } Service['munin-node']{ require => Package[munin-node], @@ -17,5 +17,5 @@ class munin::client::package inherits munin::client::base { # boot the munin-node without failure! before => Package['munin-node'], } - } } + -- cgit v1.2.3