diff options
author | mh <mh@immerda.ch> | 2013-02-28 19:14:56 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-02-28 19:14:56 +0100 |
commit | d3dae3c834c37f689af3d1b08bc0c1fd4762bd91 (patch) | |
tree | 32eb333c267620b351bdcf2973cc9ba89b783441 /manifests/plugin.pp | |
parent | d17d75fa093bbb9c38eb402ee842fb00c8e54cd3 (diff) |
linting
Diffstat (limited to 'manifests/plugin.pp')
-rw-r--r-- | manifests/plugin.pp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/manifests/plugin.pp b/manifests/plugin.pp index af8b44a..e9e5dba 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -1,33 +1,30 @@ -# plugin.pp - configure a specific munin plugin -# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> -# See LICENSE for the full license granted to you. -# adapted and improved by admin(at)immerda.ch - +# configure a specific munin plugin define munin::plugin ( - $ensure = "present", + $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_src = $ensure ? { 'present' => $name, default => $ensure } $plugin = "/etc/munin/plugins/${name}" $plugin_conf = "/etc/munin/plugin-conf.d/${name}.conf" include munin::plugins::setup case $ensure { - "absent": { + 'absent': { file { $plugin: ensure => absent, } } default: { + $dep = $::kernel ? { + OpenBSD => File['/var/run/munin'], + default => Package['munin-node'] + } file { $plugin: - ensure => "${real_script_path}/${plugin_src}", - require => $::kernel ? { - OpenBSD => File['/var/run/munin'], - default => Package['munin-node'] - }, - notify => Service['munin-node']; + ensure => "${real_script_path}/${plugin_src}", + require => $dep, + notify => Service['munin-node']; } if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){ File[$plugin]{ @@ -47,8 +44,10 @@ define munin::plugin ( } default: { file { $plugin_conf: - content => "[${name}]\n$config\n", - mode => 0644, owner => root, group => 0, + content => "[${name}]\n${config}\n", + owner => root, + group => 0, + mode => '0644', } } } |