summaryrefslogtreecommitdiff
path: root/manifests/plugin
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2015-11-28 17:41:37 +0100
committermh <mh@immerda.ch>2015-11-28 17:41:37 +0100
commit94b40fa2975cf537dd97ac2484670bc944fa09f4 (patch)
tree7b7052ad88f26bf072315e3bdd57965227d4d959 /manifests/plugin
parentc3ca4ac25d7cdfd5826149445f2946d64d968f97 (diff)
linting for future parser
Diffstat (limited to 'manifests/plugin')
-rw-r--r--manifests/plugin/deploy.pp61
1 files changed, 36 insertions, 25 deletions
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index 3f2a1a4..7681590 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -1,30 +1,41 @@
-define nagios::plugin::deploy($source = '', $ensure = 'present', $config = '', $require_package = 'nagios-plugins') {
- $plugin_src = $ensure ? {
- 'present' => $name,
- 'absent' => $name,
- default => $ensure
- }
- $real_source = $source ? {
- '' => "nagios/plugins/${plugin_src}",
- default => $source
- }
+# deploy a specific plugin
+define nagios::plugin::deploy(
+ $source = '',
+ $ensure = 'present',
+ $config = '',
+ $require_package = 'nagios-plugins'
+) {
+ $plugin_src = $ensure ? {
+ 'present' => $name,
+ 'absent' => $name,
+ default => $ensure
+ }
+ $real_source = $source ? {
+ '' => "nagios/plugins/${plugin_src}",
+ default => $source
+ }
- if !defined(Package[$require_package]) {
- package { $require_package:
- ensure => installed,
- tag => "nagios::plugin::deploy::package";
- }
+ if !defined(Package[$require_package]) {
+ package { $require_package:
+ ensure => installed,
+ tag => 'nagios::plugin::deploy::package';
}
+ }
- include nagios::plugin::scriptpaths
- file { "nagios_plugin_${name}":
- path => "$nagios::plugin::scriptpaths::script_path/${name}",
- source => "puppet:///modules/${real_source}",
- mode => 0755, owner => root, group => 0,
- require => Package[$require_package],
- tag => "nagios::plugin::deploy::file";
- }
+ include ::nagios::plugin::scriptpaths
+ file{"nagios_plugin_${name}":
+ path => "${nagios::plugin::scriptpaths::script_path}/${name}",
+ source => "puppet:///modules/${real_source}",
+ require => Package[$require_package],
+ tag => 'nagios::plugin::deploy::file',
+ owner => root,
+ group => 0,
+ mode => '0755';
+ }
- # register the plugin
- nagios::plugin{$name: ensure => $ensure, require => Package['nagios-plugins'] }
+ # register the plugin
+ nagios::plugin{$name:
+ ensure => $ensure,
+ require => Package['nagios-plugins']
+ }
}