On Thu, Aug 16, 2012 at 11:34 PM, Garrett Honeycutt
<garr...@puppetlabs.com> wrote:
> On 8/16/12 10:44 PM, Douglas Garstang wrote:
>> So, this has always puzzled me a bit. By convention, init.pp contains
>> one class, named the same as the module. However, what is the
>> convention when the module may have multiple external access points?
>> Say you have a module called 'syslog' which provides both a client and
>> a server class. I typically have used syslog::server and
>> syslog::client. I've ended up using this convention more than init.pp
>> because I don't know when I first put the class together exactly what
>> it's going to do. In module mymodule, rather than create init.pp with
>> class mymodule, I'll call it mymodule::base or something and stick it
>> in base.pp. Confused...
>>
>> Doug
>>
>
> Not all classes are meant to be directly included by nodes. A common
> practice would be having a module where you might have a base class,
> such as syslog and other sub classes, such as syslog::client and
> syslog::server. Class syslog would contain resources that were common to
> both syslog::client and syslog::server (ie: they both have a package and
> a config file). Both syslog::client and syslog::server might include (or
> possibly inherit) the syslog class. In this setup, a node might include
> syslog::server or syslog::client, but not syslog directly. When using
> this pattern, be sure to comment in your base class that it is not meant
> to be included directly.

Garrett, thanks. Aware of all that, but I'm not sure you really answer
my question. :)

Doug.

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