All;

I'm semi-new to Puppet and after having tried a couple different things 
I've developed some questions. I've read some articles that state making a 
module as self-contained as possible is a good practice. However, as I've 
tried to do that in a site with a large number of potential modules it 
becomes apparent that many of these self-contained modules will overlap in 
their resources. For example, several modules may each depend on SSSD being 
installed (Package['sssd'], Service['sssd'], etc.). If both of these 
modules declare this resource the catalog will not compile. It, then, seems 
apparent that one would want to move this resource up to a common module, 
say 'sssd', which handles all sssd-related configuration.

My question becomes how to best reference the required resources to ensure 
that my module will not compile unless the it's dependencies are included. 
A couple options I've considered:

1) Use 'include <class>' directly. The issue I see with this is that class 
names can vary between module so this can tie me in to a specific module to 
satisfy my dependency. Also, if the common module is a highly 
flexible/parameterized module I don't necessarily ensure that I've 
configured it fully before including it which may not allow my custom 
purpose-specific module to to what it is intended to do.
2) Declare the resource as a dependency for some other resource in my 
custom module (e.g. Package['sssd'] -> MyResource[]). In this way the 
catalog will not compile unless I include SOME module that provides the 
sssd package (or other resource). I'm not locked into a particular 
module/class. Also, because I have to intentionally include this module, I 
will be more likely to configure it (pass parameters) as needed to support 
my other modules depending upon it. 

Are there any other good options or is my assessment of the above two 
options off?

Thanks ahead of time!
-LJK

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/95a71694-0562-4eb2-832f-92f11046268d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to