Hello>From my understanding, modules are not autosearched. So, if I have:include ssh ... then puppet will look for a module names ssh and class named ssh defined in /modules/ssh/init.pp Moreover, if I have: include ssh::global ... then Puppet will for class global defined in /modules/ssh/init.pp or /modules/ssh/global.ss. Is that correct? Or am I leaving out some imports that are needed? -- Digant C Kasundra <digant@stanford.edu> Technical Lead, ITS Unix Systems and Applications, Stanford University
On Aug 23, 2007, at 4:30 PM, Digant C Kasundra wrote:> Hello > >> From my understanding, modules are not autosearched. So, if I have: > > include ssh > > ... then puppet will look for a module names ssh and class named ssh > defined in /modules/ssh/init.ppThey *are* autosearched, I assume you meant. It actually looks in $modulepath/ssh/manifests/init.pp. This caught me a few times, but it makes a lot of sense once you start putting templates and such in there.> Moreover, if I have: > > include ssh::global > > ... then Puppet will for class global defined in /modules/ssh/ > init.pp or > /modules/ssh/global.ss. > > Is that correct? Or am I leaving out some imports that are needed?If you add the ''manifests/'' in there, it''ll be right. -- I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are ''obviously'' no deficiencies and the other way is to make it so complicated that there are no ''obvious'' deficiencies. -- C.A.R. Hoare, Turing Lecture "The Emperor''s Old Clothes" CACM February 1981, pp. 75-83. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/23/07, Digant C Kasundra <digant@stanford.edu> wrote:> > Hello > > >From my understanding, modules are not autosearched. So, if I have: > > include ssh > > ... then puppet will look for a module names ssh and class named ssh > defined in /modules/ssh/init.ppI''m not sure of the search order here, it''s been my experience that if it''s not prefixed by the module namespace, it looks in the main manifests... but it may be that I''ve just never tried it. Moreover, if I have:> > include ssh::global > > ... then Puppet will for class global defined in /modules/ssh/init.pp or > /modules/ssh/global.ss.Yes this works, it''s what I''m doing in my modules. But I may be changing the default behavior a bit by doing this in init.pp: import "classes/*.pp" -Blake _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Aug 23, 2007, at 5:32 PM, Blake B wrote:> > I''m not sure of the search order here, it''s been my experience that > if it''s not prefixed by the module namespace, it looks in the main > manifests... but it may be that I''ve just never tried it.Puppet will only ever autoload module classes, not classes in the same directory as your main manifest, and the search order always strictly follows the order in the module path.> Yes this works, it''s what I''m doing in my modules. But I may be > changing the default behavior a bit by doing this in init.pp: > import "classes/*.pp"Yeah, that''s basically redundant but doesn''t hurt. -- Learning is not attained by chance, it must be sought for with ardor and attended to with diligence. -- Abigail Adams --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On 8/23/07, Luke Kanies <luke@madstop.com> wrote:> > On Aug 23, 2007, at 5:32 PM, Blake B wrote: > > > > I''m not sure of the search order here, it''s been my experience that > > if it''s not prefixed by the module namespace, it looks in the main > > manifests... but it may be that I''ve just never tried it. > > Puppet will only ever autoload module classes, not classes in the > same directory as your main manifest, and the search order always > strictly follows the order in the module path.Ah, right. I was thinking of whether the "include" would work or not, not whether the file would be autoloaded.> Yes this works, it''s what I''m doing in my modules. But I may be > > changing the default behavior a bit by doing this in init.pp: > > import "classes/*.pp" > > Yeah, that''s basically redundant but doesn''t hurt.cool, I''ll remove it then. :) -Blake _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users