Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
define nagios::nrpe_command ( $command, $parameters, $cplugdir="auto", $ensure="present" # , $nagios_plugin = "<none>" , $nagios_plugin ) { # find out the default nagios paths for plugis $defaultdir = $architecture ? { "x86_64" => "/usr/lib64/nagios/plugins", default => "/usr/lib/nagios/plugins" } # if we overrode cplugdir then use that, else go with the nagios default # for this architecture case $cplugdir { auto: { $pluginsdir = $defaultdir } default: { $pluginsdir = $cplugdir } } # Package requirements # if ( $nagios_plugin != "<none>" ) { # # Set a default resource for the file defines coming up... # File { # require => Package[$nagios_plugin], # } # } # This doesn't work, for reason's not yet known. case $ensure { "absent": { file {"/etc/nagios/nrpe.d/${name}.cfg": ensure => absent } package { $nagios_plugin: ensure => absent, } } default: { file {"/etc/nagios/nrpe.d/${name}.cfg": owner => root, group => root, mode => 644, content => template("nagios/nrpe_remote_d.cfg"), # require => File["/etc/nagios/nrpe.d"], require => [ File["/etc/nagios/nrpe.d"], Package[$nagios_plugin] ], } package { $nagios_plugin: ensure => latest, } } } }
This paste will be private.
From the Design Piracy series on my blog: