From 4e35b0bce0f2dd00d52e0de7488ab322867dd012 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 7 Oct 2010 10:47:02 -0400 Subject: add a nagios::plugin::deploy modeled after the munin::plugin::deploy --- manifests/plugin/deploy.pp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 manifests/plugin/deploy.pp (limited to 'manifests/plugin/deploy.pp') diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp new file mode 100644 index 0000000..75f87d7 --- /dev/null +++ b/manifests/plugin/deploy.pp @@ -0,0 +1,30 @@ +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"; + } + } + + include nagios::plugin::scriptpaths + @@file { "nagios_plugin_${name}": + path => "$nagios::plugin::scriptpaths::script_path/${name}", + source => "puppet://$server/modules/$real_source", + mode => 0755, owner => root, group => 0, + require => Package[$require_package], + tag => "nagios::plugin::deploy::file"; + } + + # register the plugin + @@nagios::plugin{$name: ensure => $ensure, require => Package['nagios-plugins'] } +} -- cgit v1.2.3