From 61cfbbf42268045b0d4f0dc0481b962e9aad9f8f Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 28 Feb 2013 20:21:53 +0100 Subject: linting --- manifests/plugin/deploy.pp | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'manifests/plugin/deploy.pp') diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 9e74afb..2928a3a 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,18 +1,25 @@ -define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { +# deploy and register a munin plugin +define munin::plugin::deploy( + $ensure = 'present', + $source = '', + $config = '', +) { $plugin_src = $ensure ? { 'present' => $name, - 'absent' => $name, - default => $ensure + 'absent' => $name, + default => $ensure } $real_source = $source ? { - '' => "munin/plugins/$plugin_src", + '' => "munin/plugins/${plugin_src}", default => $source } include munin::plugin::scriptpaths file { "munin_plugin_${name}": - path => "${munin::plugin::scriptpaths::script_path}/${name}", - source => "puppet:///modules/${real_source}", - mode => 0755, owner => root, group => 0; + path => "${munin::plugin::scriptpaths::script_path}/${name}", + source => "puppet:///modules/${real_source}", + owner => root, + group => 0, + mode => '0755'; } if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){ @@ -35,9 +42,13 @@ define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { } } # register the plugin + munin::plugin{$name: + ensure => $ensure, + config => $config + } if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } + Munin::Plugin[$name]{ + require => $require + } } } -- cgit v1.2.3