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/deploy.pp | 70 ++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 34 deletions(-) (limited to 'manifests/plugin/deploy.pp') diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 846a873..d4dbf6d 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,37 +1,39 @@ -define munin::plugin::deploy($source = '', $ensure = 'present', $config = '') { - $plugin_src = $ensure ? { - 'present' => $name, - 'absent' => $name, - default => $ensure - } - $real_source = $source ? { - '' => "munin/plugins/$plugin_src", - default => $source - } - include munin::plugin::scriptpaths - file { "munin_plugin_${name}": - path => "$munin::plugin::scriptpaths::script_path/${name}", - source => "puppet://$server/modules/$real_source", - mode => 0755, owner => root, group => 0; - } +define munin::plugin::deploy( $source = '', $ensure = 'present', $config = '' ) +{ + $plugin_src = $ensure ? { + 'present' => $name, + 'absent' => $name, + default => $ensure + } + + $real_source = $source ? { + '' => "munin/plugins/$plugin_src", + default => $source + } + + include munin::plugin::scriptpaths + + file { "munin_plugin_${name}": + path => "$munin::plugin::scriptpaths::script_path/${name}", + source => "puppet://$server/modules/$real_source", + mode => 0755, owner => root, group => 0; + } - case $kernel { - openbsd: { $basic_require = File['/var/run/munin'] } - default: { $basic_require = Package['munin-node'] } - } - if $require { - File["munin_plugin_${name}"]{ - require => [ $basic_require, $require ], - } - } else { - File["munin_plugin_${name}"]{ - require => $basic_require, - } - } - # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } + case $kernel { + openbsd: { $basic_require = File['/var/run/munin'] } + default: { $basic_require = Package['munin-node'] } + } + + if $require { File["munin_plugin_${name}"]{ require => [ $basic_require, $require ] } } + else { + File["munin_plugin_${name}"]{ + require => $basic_require, } + } + + # register the plugin + if $require { munin::plugin{$name: ensure => $ensure, config => $config, require => $require } } } + else { + munin::plugin{$name: ensure => $ensure, config => $config } + } } -- cgit v1.2.3