Re: [Puppet Users] Configuration for modules

2012-12-11 Thread Jakov Sosic

On 12/09/2012 06:15 AM, Nathan Ward wrote:


If I were to set global parameters, would I need to define it like so:
Splunk-monitor {
   parameter => blah
}
Splunk-user {
   the_same_parameter_again => blah
}

.. or is there a way to define global configuration for the parent that
applies to both:
Splunk {
   common_parameter => blah
}


I'm not expert in custom providers, but if you will write only two 
custom providers, what's the problem with first approach? The KISS 
principle...


Because even if second approach works, everyone reading your manifests 
won't know what the *_!#($ 'Splunk' is... when you don't use it anywhere 
but in that place setting the global parameters.


So in your case I would keep it simple and define it "twice", once per 
resource type.




--
Jakov Sosic
www.srce.unizg.hr

--
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.



[Puppet Users] Configuration for modules

2012-12-08 Thread Nathan Ward
I'm writing a module (with new types and new providers) to configure Splunk 
(either main servers or forwarders) that uses the Splunk REST API.

This API needs some authentication information, and I'd like that to be 
configurable per-host (ie per host that puppet agent runs on).

Is there a standard way to do this? Should I drop a new file in to 
/etc/puppet/splunk.conf (or similar) with the config parameters I want to 
use, or even better, is there a nice well defined way to do this through a 
manifest?

I've thought about setting a global parameter, I have two classes; 
'splunk-monitor' and 'splunk-user'. Planning to make these both inherit 
from a common class 'Puppet::Provider::Splunk' with some common utilities 
like REST HTTP things - I copied this approach from the package providers.

If I were to set global parameters, would I need to define it like so:
Splunk-monitor {
  parameter => blah
}
Splunk-user {
  the_same_parameter_again => blah
}

.. or is there a way to define global configuration for the parent that 
applies to both:
Splunk {
  common_parameter => blah
}

Not sure how this would work when considering enumerating all the existing 
instances of configuration that this module adds - there can be many splunk 
monitor instances configured, so I'd want to enumerate them first, much 
like how the package providers enumerate installed packages first.

I've tried to think about modules that need authentication information to 
analyse for some best practices, but haven't come across any.

Any pointers in the right direction would be greatly appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/0_B3uZ07G9AJ.
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.