Felix Schäfer
2008-Jul-31 09:42 UTC
[Puppet Users] Different defaults behaviour in module when imported and autoloaded
Hello, I ran into a little issue here with defaults in a module. Basically, I have a File {} statement for a module that I put before the first class and I expected it to be the default for the whole module. When importing it, it all works well, but when the module is autoloaded, the File {} statement is ignored. Was this done by design, and if so why, or should I consider it a bug? Thanks Felix Schäfer --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Paul Lathrop
2008-Aug-01 17:10 UTC
[Puppet Users] Re: Different defaults behaviour in module when imported and autoloaded
I don''t know if it was done by design or not, but it is definitely what I would expect; autoloading happens per-class. You are going to want to set your defaults within the class { } block. On Thu, Jul 31, 2008 at 2:42 AM, Felix Schäfer <schaefer@cypres-it.com> wrote:> > Hello, > > I ran into a little issue here with defaults in a module. Basically, I > have a File {} statement for a module that I put before the first > class and I expected it to be the default for the whole module. When > importing it, it all works well, but when the module is autoloaded, > the File {} statement is ignored. > > Was this done by design, and if so why, or should I consider it a bug? > > Thanks > > Felix Schäfer > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Schmitt
2008-Aug-01 19:03 UTC
[Puppet Users] Re: Different defaults behaviour in module when imported and autoloaded
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Friday 01 August 2008, Paul Lathrop wrote:> I don''t know if it was done by design or not, but it is definitely > what I would expect; autoloading happens per-class.Hmm? I was under the impression that the autoload for $namespace::$classname tries to load $namespace/manifests/init.pp from the modulepath and if the name is still undefined, continues to try $namespace/manifests/$classname.pp, again on the modulepath. The only thing I could find on the wiki is http://reductivelabs.com/trac/puppet/wiki/AutoloadingModules which is a "bit" vague. Regards, DavidS - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQFIk135/Pp1N6Uzh0URAt4tAJ4xNsMeFxjBYZSNs3wNFDeCEwMI4QCfeum3 oN3IY/plVQ7EGREUM4ZbkWY=K+b4 -----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 -~----------~----~----~----~------~----~------~--~---
Paul Lathrop
2008-Aug-03 16:58 UTC
[Puppet Users] Re: Different defaults behaviour in module when imported and autoloaded
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Aug 1, 2008 at 12:03 PM, David Schmitt wrote: -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: http://getfiregpg.org iEYEARECAAYFAkiV45sACgkQX6ecHn3cW4miUwCeKXZ+4TFRDhsgYwnu85pCNKsh EqwAn0giuvJUq1/ggjTaHtYXl+OcTIny =0xmF -----END PGP SIGNATURE-----> > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Friday 01 August 2008, Paul Lathrop wrote: >> I don''t know if it was done by design or not, but it is definitely >> what I would expect; autoloading happens per-class. > > Hmm? I was under the impression that the autoload for $namespace::$classname > tries to load $namespace/manifests/init.pp from the modulepath and if the > name is still undefined, continues to try $namespace/manifests/$classname.pp, > again on the modulepath. > > The only thing I could find on the wiki is > http://reductivelabs.com/trac/puppet/wiki/AutoloadingModules > which is a "bit" vague.Hrm. Now I''m less sure and think perhaps I should refer to the code... --Paul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---