From 9fd1de5acd9064a0d67ca9d2c13a829a3f628f39 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:39:49 -0300 Subject: new style for 2.7 --- manifests/plugin/deploy.pp | 72 ++++++++++++++++++++--------------------- manifests/plugin/scriptpaths.pp | 20 ++++++------ 2 files changed, 46 insertions(+), 46 deletions(-) (limited to 'manifests/plugin') diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp index 5003153..9e74afb 100644 --- a/manifests/plugin/deploy.pp +++ b/manifests/plugin/deploy.pp @@ -1,43 +1,43 @@ 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:///modules/$real_source", - mode => 0755, owner => root, group => 0; - } + $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:///modules/${real_source}", + mode => 0755, owner => root, group => 0; + } - if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){ - File["munin_plugin_${name}"]{ - seltype => 'munin_exec_t', - } + if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){ + File["munin_plugin_${name}"]{ + seltype => 'munin_exec_t', } + } - 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, - } + 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 ], } - # register the plugin - if $require { - munin::plugin{$name: ensure => $ensure, config => $config, require => $require } - } else { - munin::plugin{$name: ensure => $ensure, config => $config } + } 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 } + } } diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp index f4bd39b..2cad97b 100644 --- a/manifests/plugin/scriptpaths.pp +++ b/manifests/plugin/scriptpaths.pp @@ -1,12 +1,12 @@ class munin::plugin::scriptpaths { - case $::operatingsystem { - gentoo: { $script_path = "/usr/libexec/munin/plugins" } - debian: { $script_path = "/usr/share/munin/plugins" } - centos: { $script_path = "/usr/share/munin/plugins" } - openbsd: { $script_path = $::operatingsystemrelease ? { - '4.3' => '/opt/munin/lib/plugins/', - default => '/usr/local/libexec/munin/plugins/' - } } - default: { $script_path = "/usr/share/munin/plugins" } - } + case $::operatingsystem { + gentoo: { $script_path = "/usr/libexec/munin/plugins" } + debian: { $script_path = "/usr/share/munin/plugins" } + centos: { $script_path = "/usr/share/munin/plugins" } + openbsd: { $script_path = $::operatingsystemrelease ? { + '4.3' => '/opt/munin/lib/plugins/', + default => '/usr/local/libexec/munin/plugins/' + } } + default: { $script_path = "/usr/share/munin/plugins" } + } } -- cgit v1.2.3