I'm trying to build a NRPE management module that has the ability to
add or modify existing commands. I think Augeas would be the best
method to handle this but I'm running into a few issues. Here's what I
have so far

define nrpe::command($value) {
    include augeas
    augeas{ "${fqdn}_NRPE_${name}":
        context => "/files/${nrpe::params::conf}",
        changes => "set command[last()+1]/${name} ${value}",
        onlyif  => "get command[*]/${name} != ${value}",
        require => Class['augeas'],
    }
}

The problem is this will add duplicate commands.

What I want is something like this
nrpe::command { 'check_users': value=> 'check users command';
'check_something': value => 'check something command'; }

Which will produce this
command[check_users]=check users command
command[check_something]=check something command

Any suggestions on how to correct this?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to