Marc Zampetti
2010-Aug-06 15:16 UTC
[Puppet Users] Module/Class Naming/Organization Best Practices
All, Can anyone point me to some best practices for how one should name/organize classes and modules. I know that I should use modules for everything, and that I can references classes in one module from another class in another module. And I know about the class inheritance stuff. What I''m a little confused about is I''ve seen references to ::install and ::remove and stuff like that. In fact, I''m not sure if the "::" is anything more then naming convention, or if it means something to Puppet. Also, is the "modules" directory a flat directory, or can I have sub dirs? If so, how do I reference things in the sub dirs, or is it all just "magic". Any help is appreciated. Marc Zampetti -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Douglas Garstang
2010-Aug-06 22:24 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
On Fri, Aug 6, 2010 at 8:16 AM, Marc Zampetti <marc.zampetti@gmail.com> wrote:> All, > > Can anyone point me to some best practices for how one should name/organize > classes and modules. I know that I should use modules for everything, and > that I can references classes in one module from another class in another > module. And I know about the class inheritance stuff. > > What I''m a little confused about is I''ve seen references to ::install and > ::remove and stuff like that. In fact, I''m not sure if the "::" is anything > more then naming convention, or if it means something to Puppet. Also, is > the "modules" directory a flat directory, or can I have sub dirs? If so, how > do I reference things in the sub dirs, or is it all just "magic". > > Any help is appreciated.Marc, I think the ''::'' is a naming convention, but I''m not sure since I haven''t seen it documented anywhere. Also, you can create modules in subdirs and qualify them with ''::''. For example facility::palo_alto::appserver would be in /etc/puppet/modules/facility/palo_alto/appserver.pp. Haven''t seen that documented either, but it works. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Peter Meier
2010-Aug-08 22:05 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi> I think the ''::'' is a naming convention, but I''m not sure since I > haven''t seen it documented anywhere. Also, you can create modules in > subdirs and qualify them with ''::''. For example > facility::palo_alto::appserver would be in > /etc/puppet/modules/facility/palo_alto/appserver.pp. Haven''t seen that > documented either, but it works.to clarify: * the second example (facility::palo_alto::appserver) is not a module in a subdirectory it''s a class or define in the facility module. * both things are documented in the documentation, for example in the "Module Organization" documentation [1]. cheers pete [1] http://docs.puppetlabs.com/guides/modules.html -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxfKjYACgkQbwltcAfKi3/1GgCeKmqXaYzzhszm24d5DxRO5C3F pEkAnia3Q1Icqqo2nK8rB05dItR4dYfW =sUVO -----END PGP SIGNATURE----- -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Douglas Garstang
2010-Aug-09 15:44 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
On Sun, Aug 8, 2010 at 3:05 PM, Peter Meier <peter.meier@immerda.ch> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi > >> I think the ''::'' is a naming convention, but I''m not sure since I >> haven''t seen it documented anywhere. Also, you can create modules in >> subdirs and qualify them with ''::''. For example >> facility::palo_alto::appserver would be in >> /etc/puppet/modules/facility/palo_alto/appserver.pp. Haven''t seen that >> documented either, but it works. > > to clarify: > > * the second example (facility::palo_alto::appserver) is not a module in > a subdirectory it''s a class or define in the facility module. > * both things are documented in the documentation, for example in the > "Module Organization" documentation [1].Maybe someone at Puppet Labs can refer to it as ''autoloading'' at http://docs.reductivelabs.com/guides/modules.html then? I keep hearing people referring to this feature (which doesn''t seem to work with parameterized classes btw) as ''autoloading'' but there''s no reference to the word ''autoload*'' on that page. 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull
2010-Aug-09 21:46 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
Douglas Garstang wrote:> > Maybe someone at Puppet Labs can refer to it as ''autoloading'' at > http://docs.reductivelabs.com/guides/modules.html then? I keep hearing > people referring to this feature (which doesn''t seem to work with > parameterized classes btw) as ''autoloading'' but there''s no reference > to the word ''autoload*'' on that page. >Maybe someone in the community can also submit a patch if the documentation is proving confusing. Regards James Turnbull -- Puppet Labs - http://www.puppetlabs.com C: 503-734-8571 -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Douglas Garstang
2010-Aug-09 23:30 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
On Mon, Aug 9, 2010 at 2:46 PM, James Turnbull <james@puppetlabs.com> wrote:> Douglas Garstang wrote: >> >> Maybe someone at Puppet Labs can refer to it as ''autoloading'' at >> http://docs.reductivelabs.com/guides/modules.html then? I keep hearing >> people referring to this feature (which doesn''t seem to work with >> parameterized classes btw) as ''autoloading'' but there''s no reference >> to the word ''autoload*'' on that page. >> > > Maybe someone in the community can also submit a patch if the > documentation is proving confusing.Maybe someone in the community who knows how puppet works well enough without the documentation existing in the first place. :) 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
James Turnbull
2010-Aug-09 23:54 UTC
Re: [Puppet Users] Module/Class Naming/Organization Best Practices
Douglas Garstang wrote:> On Mon, Aug 9, 2010 at 2:46 PM, James Turnbull <james@puppetlabs.com> wrote: >> Douglas Garstang wrote: >>> Maybe someone at Puppet Labs can refer to it as ''autoloading'' at >>> http://docs.reductivelabs.com/guides/modules.html then? I keep hearing >>> people referring to this feature (which doesn''t seem to work with >>> parameterized classes btw) as ''autoloading'' but there''s no reference >>> to the word ''autoload*'' on that page. >>> >> Maybe someone in the community can also submit a patch if the >> documentation is proving confusing. > > Maybe someone in the community who knows how puppet works well enough > without the documentation existing in the first place. :)That seems a little facetious given the word "auto-load" is present not not "autoload" but to make it clearer I''ve made some edits to that page. http://docs.puppetlabs.com/guides/modules.html If those aren''t sufficient - please feel free to submit a patch. Regards James Turnbull -- Puppet Labs - http://www.puppetlabs.com C: 503-734-8571 -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.