diff options
author | mh <mh@immerda.ch> | 2013-02-28 20:21:53 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-02-28 20:21:53 +0100 |
commit | 61cfbbf42268045b0d4f0dc0481b962e9aad9f8f (patch) | |
tree | f70d53b989bec3264bac4869252dec080c769c55 /manifests/plugin | |
parent | d3dae3c834c37f689af3d1b08bc0c1fd4762bd91 (diff) |
linting
Diffstat (limited to 'manifests/plugin')
-rw-r--r-- | manifests/plugin/deploy.pp | 31 |
1 files changed, 21 insertions, 10 deletions
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 + } } } |