From d3dae3c834c37f689af3d1b08bc0c1fd4762bd91 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 28 Feb 2013 19:14:56 +0100 Subject: linting --- manifests/plugin.pp | 33 ++++++++++++++++----------------- 1 file 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 -# 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', } } } -- cgit v1.2.3