From c9c389010b40f1768f039200539cf27a032d0348 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 8 Sep 2008 20:12:12 +0200 Subject: add apache site --- manifests/host.pp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index f539c9e..af0f11b 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -37,3 +37,12 @@ class munin::snmp_collector schedule => daily } } + +define munin::apache_site() +{ + apache::site { + $name: + ensure => present, + content => template("munin/site.conf") + } +} -- cgit v1.2.3 From c223993eba487cc24425890b2b9b6abd2f6c4d35 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Sun, 31 May 2009 21:18:22 +0200 Subject: adapt to new "common" module --- manifests/host.pp | 4 ++-- manifests/init.pp | 4 ++-- manifests/plugin.pp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index af0f11b..f89cbb8 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -25,13 +25,13 @@ class munin::snmp_collector { file { - "/var/lib/puppet/modules/munin/create_snmp_links": + "${module_dir_path}/munin/create_snmp_links": source => "puppet://$servername/munin/create_snmp_links.sh", mode => 755, owner => root, group => root; } exec { "create_snmp_links": - command => "/var/lib/puppet/modules/munin/create_snmp_links $NODESDIR", + command => "${module_dir_path}/munin/create_snmp_links $NODESDIR", require => File["snmp_links"], timeout => "2048", schedule => daily diff --git a/manifests/init.pp b/manifests/init.pp index a1ea92c..4a049a4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,9 +5,9 @@ # the port is a parameter so vservers can share IP addresses and still be happy # Define where the individual nodes' configs are stored -$NODESDIR="/var/lib/puppet/modules/munin/nodes" +$NODESDIR="${module_dir_path}/munin/nodes" -modules_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } +module_dir { [ "munin", "munin/nodes", "munin/plugins" ]: } import "host.pp" import "client.pp" diff --git a/manifests/plugin.pp b/manifests/plugin.pp index a23a567..85fa444 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -53,14 +53,14 @@ define munin::remoteplugin($ensure = "present", $source, $config = '') { "absent": { munin::plugin{ $name: ensure => absent } } default: { file { - "/var/lib/puppet/modules/munin/plugins/${name}": + "${module_dir_path}/munin/plugins/${name}": source => $source, mode => 0755, owner => root, group => root; } munin::plugin { $name: ensure => $ensure, config => $config, - script_path => "/var/lib/puppet/modules/munin/plugins", + script_path => "${module_dir_path}/munin/plugins", } } } -- cgit v1.2.3 From 23dc1202b2e30355e1f45f7be882f65db8477053 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 3 Jun 2009 11:38:08 +0200 Subject: Add initialisation for munin.conf.header --- manifests/host.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index f89cbb8..1d17518 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -12,11 +12,19 @@ class munin::host dir => $NODESDIR, header => "/etc/munin/munin.conf.header", } + + file { + "/etc/munin/munin.conf.header": + source => "/etc/munin/munin.conf", + replace => no, # only initialise + mode => 0644, owner => root, group => 0, + before => File["/etc/munin/munin.conf"]; + } file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", "/var/log/munin-graph.log", "/var/log/munin-html.log"]: - ensure => present, - mode => 640, owner => munin, group => root; + ensure => present, + mode => 640, owner => munin, group => root; } } -- cgit v1.2.3 From 08156d7433c3052205a545951af7f0c5670a3a36 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 20 Jul 2009 10:15:15 +0200 Subject: Move interfaces fact to munin_interfaces This is to avoid clashes with newer facter versions which bring their own interfaces fact. --- manifests/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 85fa444..87259f7 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -88,8 +88,8 @@ class munin::plugins::base { # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { - $ifs = gsub(split($interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($interfaces, " "), "(.+)", "if_err_\\1") + $ifs = gsub(split($munin_interfaces, " "), "(.+)", "if_\\1") + $if_errs = gsub(split($munin_interfaces, " "), "(.+)", "if_err_\\1") plugin { $ifs: ensure => "if_"; $if_errs: ensure => "if_err_"; -- cgit v1.2.3 From 94eb06a3c753fcca3213bc5940d7d025dc790a37 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 23 Nov 2009 12:27:10 -0500 Subject: move plugin directory to fit new 0.25.x style and update file paths accordingly --- manifests/host.pp | 2 +- manifests/plugin.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index 1d17518..804bd02 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -34,7 +34,7 @@ class munin::snmp_collector file { "${module_dir_path}/munin/create_snmp_links": - source => "puppet://$servername/munin/create_snmp_links.sh", + source => "puppet://$server/modules/munin/create_snmp_links.sh", mode => 755, owner => root, group => root; } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 87259f7..c9bb6e5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$servername/common/empty", + source => "puppet://$server/modules/common/empty", ensure => directory, checksum => mtime, ignore => '.ignore', recurse => true, purge => true, force => true, -- cgit v1.2.3 From ab1f4cc93c5143e05fd588289ca044e132049bac Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 23 Nov 2009 12:47:24 -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.pp | 3 --- 1 file changed, 3 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index 0ad7856..b89877f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -117,8 +117,5 @@ class munin::client::debian } munin::register { $fqdn: } - - # workaround bug in munin_node_configure - plugin { "postfix_mailvolume": ensure => absent } } -- cgit v1.2.3 From 54af63deb16a02bfc8611e444bb3a64e12757f47 Mon Sep 17 00:00:00 2001 From: pietro Date: Fri, 27 Nov 2009 18:43:54 -0800 Subject: update source path --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/plugin.pp b/manifests/plugin.pp index c9bb6e5..817111d 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/modules/common/empty", + source => "puppet://$server/common/empty", ensure => directory, checksum => mtime, ignore => '.ignore', recurse => true, purge => true, force => true, -- cgit v1.2.3 From 577ff440b791ab67de77b20440b5e385fe1c9572 Mon Sep 17 00:00:00 2001 From: pietro Date: Fri, 27 Nov 2009 19:00:45 -0800 Subject: Revert "update source path" This reverts commit 54af63deb16a02bfc8611e444bb3a64e12757f47. --- manifests/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 817111d..c9bb6e5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -70,7 +70,7 @@ class munin::plugins::base { file { [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/common/empty", + source => "puppet://$server/modules/common/empty", ensure => directory, checksum => mtime, ignore => '.ignore', recurse => true, purge => true, force => true, -- cgit v1.2.3 From 8f711a933dbc0917b43d5e29b98da7157bd5727f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 19:48:36 -0500 Subject: fix some merge problems --- manifests/client.pp | 2 +- manifests/plugin.pp | 122 ---------------------------------------------------- 2 files changed, 1 insertion(+), 123 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index d033c28..24d84da 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -3,7 +3,7 @@ # See LICENSE for the full license granted to you. # Adapted and improved by admin(at)immerda.ch -class munin::client { +class munin::client inherits munin { $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } $munin_host_real = $munin_host ? { diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 75c4423..1fa4651 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -10,127 +10,6 @@ define munin::plugin ( $script_path_in = '', $config = '') { -<<<<<<< HEAD - debug ( "munin_plugin: name=$name, ensure=$ensure, script_path=$script_path" ) - $plugin = "/etc/munin/plugins/$name" - $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" - case $ensure { - "absent": { - debug ( "munin_plugin: suppressing $plugin" ) - file { $plugin: ensure => absent, } - } - default: { - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - debug ( "munin_plugin: making $plugin using src: $plugin_src" ) - file { $plugin: - ensure => "$script_path/${plugin_src}", - require => Package["munin-node"], - notify => Service["munin-node"], - } - } - } - case $config { - '': { - debug("no config for $name") - file { $plugin_conf: ensure => absent } - } - default: { - case $ensure { - absent: { - debug("removing config for $name") - file { $plugin_conf: ensure => absent } - } - default: { - debug("creating $plugin_conf") - file { $plugin_conf: - content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => root, - } - } - } - } - } -} - -define munin::remoteplugin($ensure = "present", $source, $config = '') { - case $ensure { - "absent": { munin::plugin{ $name: ensure => absent } } - default: { - file { - "${module_dir_path}/munin/plugins/${name}": - source => $source, - mode => 0755, owner => root, group => root; - } - munin::plugin { $name: - ensure => $ensure, - config => $config, - script_path => "${module_dir_path}/munin/plugins", - } - } - } -} - -class munin::plugins::base { - - file { - [ "/etc/munin/plugins", "/etc/munin/plugin-conf.d" ]: - source => "puppet://$server/modules/common/empty", - ensure => directory, checksum => mtime, - ignore => '.ignore', - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => root, - notify => Service[munin-node]; - "/etc/munin/plugin-conf.d/munin-node": - ensure => present, - mode => 0644, owner => root, group => root, - notify => Service[munin-node], - before => Package[munin-node]; - } - -} - -# handle if_ and if_err_ plugins -class munin::plugins::interfaces inherits munin::plugins::base { - - $ifs = gsub(split($munin_interfaces, " "), "(.+)", "if_\\1") - $if_errs = gsub(split($munin_interfaces, " "), "(.+)", "if_err_\\1") - plugin { - $ifs: ensure => "if_"; - $if_errs: ensure => "if_err_"; - } - - -} - -class munin::plugins::linux inherits munin::plugins::base { - - plugin { - [ df_abs, forks, iostat, memory, processes, cpu, df_inode, irqstats, - netstat, open_files, swap, df, entropy, interrupts, load, open_inodes, - vmstat - ]: - ensure => present; - acpi: - ensure => $acpi_available; - } - - include munin::plugins::interfaces -} - -class munin::plugins::debian inherits munin::plugins::base { - - plugin { apt_all: ensure => present; } - -} - -class munin::plugins::vserver inherits munin::plugins::base { - - plugin { - [ netstat, processes ]: - ensure => present; - } - -======= include munin::plugin::scriptpaths $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } @@ -182,5 +61,4 @@ class munin::plugins::vserver inherits munin::plugins::base { } } } ->>>>>>> 76352415fec5c2ab6975e3a8843dd4983f7cae6a } -- cgit v1.2.3 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') 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') 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') 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') 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 5abd8f38402f08a3cbb544681ca47ff44e4253e6 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:49:00 -0500 Subject: move the munin-kill cronjob into the centos-specific case. this is not something debian needs AFAICT --- manifests/host.pp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index 9fd637d..fd70710 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -32,14 +32,15 @@ class munin::host inherits munin include munin::plugins::muninhost case $operatingsystem { - centos: { include munin::host::cgi } + centos: { + include munin::host::cgi + # from time to time we cleanup hanging munin-runs + file{'/etc/cron.d/munin_kill': + content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n", + owner => root, group => 0, mode => 0644; + } + } } - - # from time to time we cleanup hanging munin-runs - file{'/etc/cron.d/munin_kill': - content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n", - owner => root, group => 0, mode => 0644; - } if $use_shorewall { include shorewall::rules::out::munin } -- cgit v1.2.3 From 3594e9a5ab49ae2a60915c788d3ca3b0e979078b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:51:18 -0500 Subject: fix formatting to be standard --- manifests/host.pp | 68 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index fd70710..c1fa3db 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,43 +4,43 @@ class munin::host inherits munin { - package {"munin": ensure => installed, } - - File <<| tag == 'munin' |>> - - file{'/etc/munin/munin.conf.header': - source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/munin.conf.header", - "puppet://$server/modules/site-munin/config/host/munin.conf.header.$operatingsystem", - "puppet://$server/modules/site-munin/config/host/munin.conf.header", - "puppet://$server/modules/munin/config/host/munin.conf.header.$operatingsystem", - "puppet://$server/modules/munin/config/host/munin.conf.header" ], - notify => Exec['concat_/etc/munin/munin.conf'], + package {"munin": ensure => installed, } + + File <<| tag == 'munin' |>> + + file{'/etc/munin/munin.conf.header': + source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/munin.conf.header", + "puppet://$server/modules/site-munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/modules/site-munin/config/host/munin.conf.header", + "puppet://$server/modules/munin/config/host/munin.conf.header.$operatingsystem", + "puppet://$server/modules/munin/config/host/munin.conf.header" ], + notify => Exec['concat_/etc/munin/munin.conf'], + owner => root, group => 0, mode => 0644; + } + + concatenated_file { "/etc/munin/munin.conf": + dir => '/var/lib/puppet/modules/munin/nodes', + header => "/etc/munin/munin.conf.header", + } + + file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", + "/var/log/munin-graph.log", "/var/log/munin-html.log"]: + ensure => present, + mode => 640, owner => munin, group => 0; + } + + include munin::plugins::muninhost + + case $operatingsystem { + centos: { + include munin::host::cgi + # from time to time we cleanup hanging munin-runs + file{'/etc/cron.d/munin_kill': + content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n", owner => root, group => 0, mode => 0644; - } - - concatenated_file { "/etc/munin/munin.conf": - dir => '/var/lib/puppet/modules/munin/nodes', - header => "/etc/munin/munin.conf.header", - } - - file { ["/var/log/munin-update.log", "/var/log/munin-limits.log", - "/var/log/munin-graph.log", "/var/log/munin-html.log"]: - ensure => present, - mode => 640, owner => munin, group => 0; - } - - include munin::plugins::muninhost - - case $operatingsystem { - centos: { - include munin::host::cgi - # from time to time we cleanup hanging munin-runs - file{'/etc/cron.d/munin_kill': - content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n", - owner => root, group => 0, mode => 0644; - } } } + } if $use_shorewall { include shorewall::rules::out::munin } -- 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') 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') 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 556b274473452c9f95a02714e7686d3918f54dde Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 22 Dec 2009 20:58:14 -0500 Subject: more formatting standardizations --- manifests/plugins/debian.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/plugins/debian.pp b/manifests/plugins/debian.pp index f239989..970fa9d 100644 --- a/manifests/plugins/debian.pp +++ b/manifests/plugins/debian.pp @@ -1,4 +1,4 @@ class munin::plugins::debian inherits munin::plugins::base { - munin::plugin { apt_all: ensure => present; } + munin::plugin { apt_all: ensure => present; } } -- 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 + manifests/plugins/base.pp | 2 +- manifests/plugins/centos.pp | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 manifests/plugins/centos.pp (limited to 'manifests') 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 } diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index 4658acc..5fc2476 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -15,7 +15,7 @@ class munin::plugins::base { munin::plugin { [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, uptime, users, vmstat + processes, swap, uptime, vmstat ]: ensure => present, } diff --git a/manifests/plugins/centos.pp b/manifests/plugins/centos.pp new file mode 100644 index 0000000..60c706c --- /dev/null +++ b/manifests/plugins/centos.pp @@ -0,0 +1,3 @@ +class munin::plugins::centos inherits munin::plugins::base { + munin::plugin { users: ensure => present; } +} -- 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') 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.pp | 2 +- manifests/client/package.pp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index 24d84da..1767c00 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -17,7 +17,7 @@ class munin::client inherits munin { darwin: { include munin::client::darwin } debian,ubuntu: { include munin::client::debian } gentoo: { include munin::client::gentoo } - centos: { include munin::client::package } + centos: { include munin::client::centos } default: { include munin::client::base } } if $use_shorewall { 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 ++++++- manifests/host.pp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'manifests') 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], } diff --git a/manifests/host.pp b/manifests/host.pp index c1fa3db..3306195 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -4,7 +4,12 @@ class munin::host inherits munin { - package {"munin": ensure => installed, } + + case $munin_ensure_version { + '': { $munin_ensure_version = "installed" } + } + + package {"munin": ensure => $munin_ensure_version, } File <<| tag == 'munin' |>> -- 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') 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 +--- manifests/host.pp | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'manifests') 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']{ diff --git a/manifests/host.pp b/manifests/host.pp index 3306195..e6b3916 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -5,9 +5,7 @@ class munin::host inherits munin { - case $munin_ensure_version { - '': { $munin_ensure_version = "installed" } - } + if $munin_ensure_version == '' { $munin_ensure_version = 'installed' } package {"munin": ensure => $munin_ensure_version, } -- cgit v1.2.3 From 637db5c2a02ab38df60e5c18dbb470db6c15c186 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 9 Aug 2010 17:34:43 -0400 Subject: have munin::host::cgi inherit munin::host. this prevents you from having to include both in the node definition for your munin host --- manifests/host/cgi.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index aeb0cdf..3039de1 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,4 +1,4 @@ -class munin::host::cgi { +class munin::host::cgi inherits munin::host { exec{'set_modes_for_cgi': command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, -- cgit v1.2.3 From 79ad433298c1646c17ccb336d4d06c3a6296ffdb Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 9 Aug 2010 18:12:29 -0400 Subject: add an $operatingsystem case to the host/cgi.pp for Debian, because the default apache group is www-data, not apache --- manifests/host/cgi.pp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'manifests') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 3039de1..45e0034 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,16 +1,27 @@ class munin::host::cgi inherits munin::host { - exec{'set_modes_for_cgi': + case $operatingsystem { + debian: { + exec{'set_modes_for_cgi': + command => 'chgrp www-data /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R www-data {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } + } + default: { + exec{'set_modes_for_cgi': command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], + } } + } - file{'/etc/logrotate.d/munin': - source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate", - "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem", - "puppet://$server/modules/site-munin/config/host/logrotate", - "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/modules/munin/config/host/logrotate" ], - owner => root, group => 0, mode => 0644; - } + file{'/etc/logrotate.d/munin': + source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate", + "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem", + "puppet://$server/modules/site-munin/config/host/logrotate", + "puppet://$server/modules/munin/config/host/logrotate.$operatingsystem", + "puppet://$server/modules/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } -- 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') 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 + manifests/host/cgi.pp | 8 ++-- manifests/plugin.pp | 91 ++++++++++++++++++++--------------------- manifests/plugin/deploy.pp | 70 ++++++++++++++++--------------- manifests/plugin/scriptpaths.pp | 3 +- manifests/plugins/apache.pp | 10 +++-- manifests/plugins/base.pp | 91 ++++++++++++++++++++++------------------- manifests/plugins/dom0.pp | 15 +++---- manifests/plugins/gentoo.pp | 4 +- manifests/plugins/interfaces.pp | 32 +++++++-------- manifests/plugins/linux.pp | 16 ++++---- manifests/plugins/openbsd.pp | 14 +++---- manifests/plugins/physical.pp | 8 ++-- manifests/plugins/selinux.pp | 6 ++- manifests/plugins/vserver.pp | 10 +++-- manifests/register.pp | 24 +++++------ manifests/register_snmp.pp | 37 +++++++++-------- manifests/remoteplugin.pp | 30 +++++++------- manifests/snmp_collector.pp | 24 +++++------ 24 files changed, 342 insertions(+), 301 deletions(-) (limited to 'manifests') 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'], } + } diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 45e0034..0cb3b32 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,14 +1,15 @@ class munin::host::cgi inherits munin::host { + case $operatingsystem { debian: { - exec{'set_modes_for_cgi': + exec { 'set_modes_for_cgi': command => 'chgrp www-data /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/munin/* -maxdepth 1 -type d -exec chgrp -R www-data {} \; && find /var/www/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], } } default: { - exec{'set_modes_for_cgi': + exec { 'set_modes_for_cgi': command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, subscribe => File['/etc/munin/munin.conf.header'], @@ -16,7 +17,7 @@ class munin::host::cgi inherits munin::host { } } - file{'/etc/logrotate.d/munin': + file{ '/etc/logrotate.d/munin': source => [ "puppet://$server/modules/site-munin/config/host/${fqdn}/logrotate", "puppet://$server/modules/site-munin/config/host/logrotate.$operatingsystem", "puppet://$server/modules/site-munin/config/host/logrotate", @@ -24,4 +25,5 @@ class munin::host::cgi inherits munin::host { "puppet://$server/modules/munin/config/host/logrotate" ], owner => root, group => 0, mode => 0644; } + } diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 1fa4651..10aab79 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -8,57 +8,54 @@ define munin::plugin ( $ensure = "present", $script_path_in = '', - $config = '') + $config = '' ) { - include munin::plugin::scriptpaths - $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } - $plugin_src = $ensure ? { "present" => $name, default => $ensure } - $plugin = "/etc/munin/plugins/$name" - $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" - case $ensure { - "absent": { - file { $plugin: ensure => absent, } - } - default: { - case $kernel { - openbsd: { $basic_require = File['/var/run/munin'] } - default: { $basic_require = Package['munin-node'] } - } - if $require { - $real_require = [ $require, $basic_require ] - } else { - $real_require = $basic_require - } - file { $plugin: - ensure => "${real_script_path}/${plugin_src}", - require => $real_require, - notify => Service['munin-node']; - } - - } + include munin::plugin::scriptpaths + $real_script_path = $script_path_in ? { '' => $munin::plugin::scriptpaths::script_path, default => $script_path_in } + + $plugin_src = $ensure ? { "present" => $name, default => $ensure } + $plugin = "/etc/munin/plugins/$name" + $plugin_conf = "/etc/munin/plugin-conf.d/$name.conf" + + case $ensure { + "absent": { + file { $plugin: ensure => absent, } } - case $config { - '': { - file { $plugin_conf: ensure => absent } - } + default: { + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } + if $require { $real_require = [ $require, $basic_require ] } + else { + $real_require = $basic_require + } + file { $plugin: + ensure => "${real_script_path}/${plugin_src}", + require => $real_require, + notify => Service['munin-node']; + } + } + } + + case $config { + '': { file { $plugin_conf: ensure => absent } } + default: { + case $ensure { + absent: { file { $plugin_conf: ensure => absent } } default: { - case $ensure { - absent: { - file { $plugin_conf: ensure => absent } - } - default: { - file { $plugin_conf: - content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => 0, - } - if $require { - File[$plugin_conf]{ - require +> $require, - } - } - } - } + file { $plugin_conf: + content => "[${name}]\n$config\n", + mode => 0644, owner => root, group => 0, + } + if $require { + File[$plugin_conf]{ + require +> $require, + } + } } + } } + } } diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 846a873..d4dbf6d 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,37 +1,39 @@ -define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { - 'present' => $name, - 'absent' => $name, - default => $ensure - } - $real_source = $source ? { - '' => "munin/plugins/$plugin_src", - default => $source - } - include munin::plugin::scriptpaths - file { "munin_plugin_${name}": - path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/modules/$real_source", - mode => 0755, owner => root, group => 0; - } +define munin::plugin::deploy( $source = '', $ensure = 'present', $config = '' ) +{ + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } + + $real_source = $source ? { + '' => "munin/plugins/$plugin_src", + default => $source + } + + include munin::plugin::scriptpaths + + file { "munin_plugin_${name}": + path => "$munin::plugin::scriptpaths::script_path/${name}", + source => "puppet://$server/modules/$real_source", + mode => 0755, owner => root, group => 0; + } - case $kernel { - openbsd: { $basic_require = File['/var/run/munin'] } - default: { $basic_require = Package['munin-node'] } - } - if $require { - File["munin_plugin_${name}"]{ - require => [ $basic_require, $require ], - } - } else { - File["munin_plugin_${name}"]{ - require => $basic_require, - } - } - # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } + + if $require { File["munin_plugin_${name}"]{ require => [ $basic_require, $require ] } } + else { + File["munin_plugin_${name}"]{ + require => $basic_require, } + } + + # register the plugin + if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } } } + else { + munin::plugin{$name: ensure => $ensure, config => $config } + } } diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp index ebaa6fa..bfdf1be 100644 --- a/manifests/plugin/scriptpaths.pp +++ b/manifests/plugin/scriptpaths.pp @@ -1,5 +1,6 @@ class munin::plugin::scriptpaths { - case $operatingsystem { + + case $operatingsystem { gentoo: { $script_path = "/usr/libexec/munin/plugins" } debian: { $script_path = "/usr/share/munin/plugins" } centos: { $script_path = "/usr/share/munin/plugins" } diff --git a/manifests/plugins/apache.pp b/manifests/plugins/apache.pp index ee90de8..030e7e6 100644 --- a/manifests/plugins/apache.pp +++ b/manifests/plugins/apache.pp @@ -1,6 +1,8 @@ class munin::plugins::apache inherits munin::plugins::base { - munin::plugin{ "apache_accesses": } - munin::plugin{ "apache_processes": } - munin::plugin{ "apache_volume": } - munin::plugin::deploy { "apache_activity": } + + munin::plugin{ "apache_accesses": } + munin::plugin{ "apache_processes": } + munin::plugin{ "apache_volume": } + munin::plugin::deploy { "apache_activity": } + } diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index 5fc2476..64756bc 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -1,50 +1,55 @@ class munin::plugins::base { - file { - [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - source => "puppet://$server/modules/common/empty", - ignore => [ '\.ignore', 'snmp_*' ], - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => 0, - notify => Service['munin-node']; - '/etc/munin/plugin-conf.d/munin-node': - ensure => present, - mode => 0644, owner => root, group => 0, - notify => Service['munin-node'], - } - munin::plugin { - [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, uptime, vmstat - ]: - ensure => present, - } - include munin::plugins::interfaces + file { + [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: + source => "puppet://$server/modules/common/empty", + ignore => [ '\.ignore', 'snmp_*' ], + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => 0, + notify => Service['munin-node']; - case $kernel { - openbsd: { - File['/etc/munin/plugin-conf.d/munin-node']{ - before => File['/var/run/munin'], - } - } - default: { - File['/etc/munin/plugin-conf.d/munin-node']{ - before => Package['munin-node'], - } - } + '/etc/munin/plugin-conf.d/munin-node': + ensure => present, + mode => 0644, owner => root, group => 0, + notify => Service['munin-node'], + } + + munin::plugin { + [ df, cpu, interrupts, load, memory, netstat, open_files, + processes, swap, uptime, vmstat ]: + ensure => present, + } + + include munin::plugins::interfaces + + case $kernel { + openbsd: { + File['/etc/munin/plugin-conf.d/munin-node']{ + before => File['/var/run/munin'], + } } - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } + default: { + File['/etc/munin/plugin-conf.d/munin-node']{ + before => Package['munin-node'], + } } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } + } + + case $kernel { + linux: { + case $vserver { + guest: { include munin::plugins::vserver } + default: { + include munin::plugins::linux + } + } } + } + + case $virtual { + physical: { include munin::plugins::physical } + xen0: { include munin::plugins::dom0 } + } + } diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp index 8d919c3..3efc6bd 100644 --- a/manifests/plugins/dom0.pp +++ b/manifests/plugins/dom0.pp @@ -1,9 +1,10 @@ class munin::plugins::dom0 inherits munin::plugins::physical { - munin::plugin::deploy { "xen": config => "user root"} - munin::plugin::deploy { "xen-cpu": config => "user root"} - munin::plugin::deploy { "xen_memory": config => "user root"} - munin::plugin::deploy { "xen_mem": config => "user root"} - munin::plugin::deploy { "xen_vm": config => "user root"} - munin::plugin::deploy { "xen_vbd": config => "user root"} - munin::plugin::deploy { "xen_traffic_all": config => "user root"} + + munin::plugin::deploy { "xen": config => "user root"} + munin::plugin::deploy { "xen-cpu": config => "user root"} + munin::plugin::deploy { "xen_memory": config => "user root"} + munin::plugin::deploy { "xen_mem": config => "user root"} + munin::plugin::deploy { "xen_vm": config => "user root"} + munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp index 81d0e6b..6d02a24 100644 --- a/manifests/plugins/gentoo.pp +++ b/manifests/plugins/gentoo.pp @@ -1,3 +1,5 @@ class munin::plugins::gentoo inherits munin::plugins::base { - munin::plugin::deploy { "gentoo_lastupdated": config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"} + + munin::plugin::deploy { "gentoo_lastupdated": config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"} + } diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 99b85ba..de4b75b 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,22 +1,22 @@ # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { + + $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") - $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") - munin::plugin { - $ifs: ensure => "if_"; + munin::plugin { $ifs: ensure => "if_"; } + + case $operatingsystem { + openbsd: { + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") + munin::plugin{ + $if_errs: ensure => "if_errcoll_"; + } } - case $operatingsystem { - openbsd: { - $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") - munin::plugin{ - $if_errs: ensure => "if_errcoll_"; - } - } - default: { - $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") - munin::plugin{ - $if_errs: ensure => "if_err_"; - } - } + default: { + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") + munin::plugin{ + $if_errs: ensure => "if_err_"; + } } + } } diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp index c7beb59..5c6afe9 100644 --- a/manifests/plugins/linux.pp +++ b/manifests/plugins/linux.pp @@ -1,10 +1,12 @@ class munin::plugins::linux inherits munin::plugins::base { - munin::plugin { - [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: - ensure => present; - acpi: - ensure => $acpi_available; - } - include munin::plugins::interfaces + munin::plugin { + [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: + ensure => present; + acpi: + ensure => $acpi_available; + } + + include munin::plugins::interfaces + } diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp index 67cf32d..feb71fb 100644 --- a/manifests/plugins/openbsd.pp +++ b/manifests/plugins/openbsd.pp @@ -1,13 +1,9 @@ class munin::plugins::openbsd inherits munin::plugins::base { - munin::plugin { + + munin::plugin { [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, users, vmstat - ]: - ensure => present, - } - munin::plugin { - [ memory_pools, memory_types ]: + processes, swap, users, vmstat, memory_pools, memory_types ]: ensure => present, - } - + } + } diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp index 6706711..1bf1465 100644 --- a/manifests/plugins/physical.pp +++ b/manifests/plugins/physical.pp @@ -1,5 +1,7 @@ class munin::plugins::physical inherits munin::plugins::base { - case $kernel { - linux: { munin::plugin { iostat: } } - } + + case $kernel { + linux: { munin::plugin { iostat: } } + } + } diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp index 6affc86..847f0b9 100644 --- a/manifests/plugins/selinux.pp +++ b/manifests/plugins/selinux.pp @@ -1,4 +1,6 @@ class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } - munin::plugin::deploy { "selinux_avcstats": } + + munin::plugin::deploy { "selinuxenforced": } + munin::plugin::deploy { "selinux_avcstats": } + } diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp index bce28a1..ffc4b0a 100644 --- a/manifests/plugins/vserver.pp +++ b/manifests/plugins/vserver.pp @@ -1,7 +1,9 @@ class munin::plugins::vserver inherits munin::plugins::base { - munin::plugin { - [ netstat, processes ]: - ensure => present; - } + + munin::plugin { + [ netstat, processes ]: + ensure => present; + } + } diff --git a/manifests/register.pp b/manifests/register.pp index e1271e1..55b98fe 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,17 +1,17 @@ define munin::register() { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, - default => $munin_host - } - - @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": - ensure => present, - content => template("munin/defaultclient.erb"), - tag => 'munin', - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + } + + @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + tag => 'munin', + } } diff --git a/manifests/register_snmp.pp b/manifests/register_snmp.pp index e74ba44..1ce606e 100644 --- a/manifests/register_snmp.pp +++ b/manifests/register_snmp.pp @@ -1,21 +1,22 @@ # snmp_testplugin: the plugin we use to test if it's set -define munin::register_snmp( - $snmpd_testplugin = 'load' -) +define munin::register_snmp( $snmpd_testplugin = 'load' ) { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => '*', - 'fqdn' => '*', - default => $munin_host - } - exec{"register_snmp_munin_for_${name}": - command => "munin-node-configure-snmp ${name} | sh", - unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", - } - @@file { "munin_snmp_${name}": path => "/var/lib/puppet/modules/munin/nodes/${name}", - ensure => present, - content => template("munin/snmpclient.erb"), - tag => 'munin', - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + + exec{"register_snmp_munin_for_${name}": + command => "munin-node-configure-snmp ${name} | sh", + unless => "test -e /etc/munin/plugins/snmp_${name}_${snmpd_testplugin}", + } + + @@file { "munin_snmp_${name}": + path => "/var/lib/puppet/modules/munin/nodes/${name}", + ensure => present, + content => template("munin/snmpclient.erb"), + tag => 'munin', + } } diff --git a/manifests/remoteplugin.pp b/manifests/remoteplugin.pp index 4bca235..cc83f8c 100644 --- a/manifests/remoteplugin.pp +++ b/manifests/remoteplugin.pp @@ -1,18 +1,18 @@ -define munin::remoteplugin($ensure = "present", $source, $config = '') { - case $ensure { - "absent": { munin::plugin{ $name: ensure => absent } } - default: { - file { - "/var/lib/puppet/modules/munin/plugins/${name}": - source => $source, - mode => 0755, owner => root, group => 0; - } - munin::plugin { $name: - ensure => $ensure, - config => $config, - script_path_in => "/var/lib/puppet/modules/munin/plugins", - } - } +define munin::remoteplugin($ensure = "present", $source, $config = '') +{ + case $ensure { + "absent": { munin::plugin{ $name: ensure => absent } } + default: { + file { "/var/lib/puppet/modules/munin/plugins/${name}": + source => $source, + mode => 0755, owner => root, group => 0; + } + munin::plugin { $name: + ensure => $ensure, + config => $config, + script_path_in => "/var/lib/puppet/modules/munin/plugins", + } } + } } diff --git a/manifests/snmp_collector.pp b/manifests/snmp_collector.pp index 4f72b95..3b60541 100644 --- a/manifests/snmp_collector.pp +++ b/manifests/snmp_collector.pp @@ -1,14 +1,14 @@ -class munin::snmp_collector{ - file { - "/var/lib/puppet/modules/munin/create_snmp_links": - source => "puppet://$server/modules/munin/create_snmp_links.sh", - mode => 755, owner => root, group => 0; - } +class munin::snmp_collector { - exec { "create_snmp_links": - command => "/var/lib/puppet/modules/munin/create_snmp_links /var/lib/puppet/modules/munin/nodes", - require => File["snmp_links"], - timeout => "2048", - schedule => daily - } + file { "/var/lib/puppet/modules/munin/create_snmp_links": + source => "puppet://$server/modules/munin/create_snmp_links.sh", + mode => 755, owner => root, group => 0; + } + + exec { "create_snmp_links": + command => "/var/lib/puppet/modules/munin/create_snmp_links /var/lib/puppet/modules/munin/nodes", + require => File["snmp_links"], + timeout => "2048", + schedule => daily + } } -- cgit v1.2.3 From d4ba356a919c557cdd25f6038b8d0284366a2fe8 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 10 Dec 2010 17:01:29 -0500 Subject: another formatting fix --- manifests/client.pp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'manifests') diff --git a/manifests/client.pp b/manifests/client.pp index 1767c00..234523f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -5,22 +5,24 @@ class munin::client inherits munin { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => '*', - 'fqdn' => '*', - default => $munin_host - } - - case $operatingsystem { - openbsd: { include munin::client::openbsd } - darwin: { include munin::client::darwin } - debian,ubuntu: { include munin::client::debian } - gentoo: { include munin::client::gentoo } - centos: { include munin::client::centos } - default: { include munin::client::base } - } - if $use_shorewall { - include shorewall::rules::munin - } + $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } + $munin_host_real = $munin_host ? { + '' => '*', + 'fqdn' => '*', + default => $munin_host + } + + case $operatingsystem { + openbsd: { include munin::client::openbsd } + darwin: { include munin::client::darwin } + debian,ubuntu: { include munin::client::debian } + gentoo: { include munin::client::gentoo } + centos: { include munin::client::centos } + default: { include munin::client::base } + } + + if $use_shorewall { + include shorewall::rules::munin + } + } -- cgit v1.2.3 From 6a5439f2ad807f15f588266432afa8fc2cd76410 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sun, 12 Dec 2010 18:15:06 -0500 Subject: fix syntax error introduced with previous commit --- manifests/plugin/deploy.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests') diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index d4dbf6d..0ab4e9f 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -32,7 +32,7 @@ define munin::plugin::deploy( $source = '', $ensure = 'present', $config = '' ) } # register the plugin - if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } } } + if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } } else { munin::plugin{$name: ensure => $ensure, config => $config } } -- cgit v1.2.3 From e7cb137590fc0c28da9854252c76c3e08b866c63 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 24 Mar 2011 23:28:25 -0400 Subject: remove outdated and undesirable apt_all plugin on debian systems which triggers random apt-get update commands Conflicts: manifests/plugins/debian.pp --- manifests/plugins/debian.pp | 2 -- 1 file changed, 2 deletions(-) (limited to 'manifests') diff --git a/manifests/plugins/debian.pp b/manifests/plugins/debian.pp index 970fa9d..6d2faef 100644 --- a/manifests/plugins/debian.pp +++ b/manifests/plugins/debian.pp @@ -1,4 +1,2 @@ class munin::plugins::debian inherits munin::plugins::base { - munin::plugin { apt_all: ensure => present; } } - -- cgit v1.2.3 From 105b64eee4c6e326aa5e7e9c842318b45f72977b Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Mon, 1 Feb 2010 15:31:06 -0500 Subject: remove nagios plugin, now provided by nagios module --- manifests/plugins/nagios.pp | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 manifests/plugins/nagios.pp (limited to 'manifests') diff --git a/manifests/plugins/nagios.pp b/manifests/plugins/nagios.pp deleted file mode 100644 index c07e99d..0000000 --- a/manifests/plugins/nagios.pp +++ /dev/null @@ -1,20 +0,0 @@ -class munin::plugins::nagios inherits munin::plugins::base { - - munin::plugin::deploy { - nagios_hosts: config => 'user root'; - nagios_svc: config => 'user root'; - nagios_perf_hosts: ensure => nagios_perf_, config => 'user root'; - nagios_perf_svc: ensure => nagios_perf_, config => 'user root'; - } - - exec { 'munin_nagios2stats_link': - command => 'ln -s /usr/sbin/nagios2stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios2stats"], - } - - exec { 'munin_nagios3stats_link': - command => 'ln -s /usr/sbin/nagios3stats /usr/local/sbin/nagiostats', - onlyif => ["test ! -e /usr/local/sbin/nagiostats", "test -e /usr/sbin/nagios3stats"], - } - -} -- cgit v1.2.3 From b3e29447187e289c60a4a9f7830032f1b10fae2f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 24 Mar 2011 23:31:58 -0400 Subject: add ability to register a non-puppet-managed munin node Conflicts: manifests/register.pp --- manifests/register.pp | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'manifests') diff --git a/manifests/register.pp b/manifests/register.pp index 55b98fe..59500a0 100644 --- a/manifests/register.pp +++ b/manifests/register.pp @@ -1,17 +1,30 @@ -define munin::register() +define munin::register( + $host = 'absent', + $port = 'absent' +) { - $munin_port_real = $munin_port ? { '' => 4949, default => $munin_port } - $munin_host_real = $munin_host ? { - '' => $fqdn, - 'fqdn' => $fqdn, - default => $munin_host - } - - @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": - ensure => present, - content => template("munin/defaultclient.erb"), - tag => 'munin', + $munin_port_real = $port ? { + 'absent' => $munin_port ? { + '' => 4949, + default => $munin_port + }, + default => $port } + + $munin_host_real = $host ? { + 'absent' => $munin_host ? { + '' => $fqdn, + 'fqdn' => $fqdn, + default => $munin_host + }, + default => $host + } + + @@file { "/var/lib/puppet/modules/munin/nodes/${name}_${munin_port_real}": + ensure => present, + content => template("munin/defaultclient.erb"), + tag => 'munin', + } } -- 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') 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 From e17c0e0fae335470971cc628d71a798d168e70af Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Tue, 29 Mar 2011 17:18:40 -0400 Subject: fix merge conflict syntax error --- manifests/host.pp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'manifests') diff --git a/manifests/host.pp b/manifests/host.pp index cf445ce..9d30d6a 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -18,6 +18,8 @@ class munin::host inherits munin "puppet:///modules/munin/config/host/munin.conf.header.$operatingsystem", "puppet:///modules/munin/config/host/munin.conf.header" ], notify => Exec['concat_/etc/munin/munin.conf'], + owner => root, group => 0, mode => 0644; + } concatenated_file { "/etc/munin/munin.conf": dir => '/var/lib/puppet/modules/munin/nodes', -- cgit v1.2.3