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/plugin.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/plugin.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 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/plugin.pp') 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/plugin.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugin.pp') 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 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/plugin.pp') 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/plugin.pp') 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/plugin.pp | 122 ---------------------------------------------------- 1 file changed, 122 deletions(-) (limited to 'manifests/plugin.pp') 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 74f66a8e77b153552ef52efee03187320e1ce877 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 10 Dec 2010 16:48:01 -0500 Subject: standardize formatting --- manifests/plugin.pp | 91 ++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 47 deletions(-) (limited to 'manifests/plugin.pp') 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, + } + } } + } } + } } -- cgit v1.2.3