My understanding was that at the beginning of each run the puppetmaster imports all modules so that any includes at the top level are applied directly. However, I am not so sure anymore. I''ve been tracing how this works and it seems like modules are included more lazily. In other words, when able_to_import is called seems like when the magic happens, rather than up front when the run starts. Could I get some clarification on when all the modules get imported and what part of them gets loaded? Thanks. -eric -- 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.
----- "Eric Snow" <esnow@verio.net> wrote:> My understanding was that at the beginning of each run the > puppetmaster imports all modules so that any includes at the top > level > are applied directly. However, I am not so sure anymore. > > I''ve been tracing how this works and it seems like modules are > included more lazily. In other words, when able_to_import is called > seems like when the magic happens, rather than up front when the run > starts. > > Could I get some clarification on when all the modules get imported > and what part of them gets loaded? Thanks.my understanding is that it''s lazy and on demand. Why does it matter in general use that should be fine, so curious what your use is -- R.I.Pienaar -- 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.
Trying to track down why all the modules in my production environment are auto-loaded at the beginning of a run for a node that is in my development environment. The run fails because it cannot find the modules in my development environment which are named differently from production. Makes me think that the wrong ones are getting auto- loaded, or that it is looking for the development modules in the wrong place. -eric On Nov 11, 9:14 am, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > My understanding was that at the beginning of each run the > > puppetmaster imports all modules so that any includes at the top > > level > > are applied directly. However, I am not so sure anymore. > > > I''ve been tracing how this works and it seems like modules are > > included more lazily. In other words, when able_to_import is called > > seems like when the magic happens, rather than up front when the run > > starts. > > > Could I get some clarification on when all the modules get imported > > and what part of them gets loaded? Thanks. > > my understanding is that it''s lazy and on demand. Why does it matter in > general use that should be fine, so curious what your use is > > -- > R.I.Pienaar-- 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.
R.I.Pienaar
2010-Nov-11 16:26 UTC
Re: [Puppet Users] Re: When do modules get auto-imported
----- "Eric Snow" <esnow@verio.net> wrote:> Trying to track down why all the modules in my production environment > are auto-loaded at the beginning of a run for a node that is in my > development environment. The run fails because it cannot find the > modules in my development environment which are named differently > from > production. Makes me think that the wrong ones are getting auto- > loaded, or that it is looking for the development modules in the > wrong > place.would be best if you showed how its set up, file names classes etc -- 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.
-- puppet.conf -- [main] modulepath = /usr/share/puppet/production/modules [development] modulepath = /usr/share/puppet/development/modules/settings [testing] modulepath = /usr/share/puppet/testing/modules [production] modulepath = /usr/share/puppet/production/modules -- /usr/share/puppet/development/modules/settings -- settings |-- all |-- manifests |-- init.pp |-- hosttypes.pp -- node (in development) -- node test { include hosttypes::unassigned } -- init.pp -- import "*" -- hosttypes.pp -- class hosttypes::unassigned { notify {"hosttypes::unassigned ": } notice("hosttypes::unassigned ") service {"httpd": enable => false, ensure => stopped, } } -- output -- /usr/sbin/puppetd --logdest console --test --noop info: Caching catalog for <HOSTNAME> info: Applying configuration version ''1289493629'' notice: Finished catalog run in 0.51 seconds The httpd service is enabled and running when this run happens so it should report the noop. As well, neither the notice nor the notify happens. This is a simplification, but represents our situation. -eric On Nov 11, 9:26 am, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > Trying to track down why all the modules in my production environment > > are auto-loaded at the beginning of a run for a node that is in my > > development environment. The run fails because it cannot find the > > modules in my development environment which are named differently > > from > > production. Makes me think that the wrong ones are getting auto- > > loaded, or that it is looking for the development modules in the > > wrong > > place. > > would be best if you showed how its set up, file names classes etc-- 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.
On the puppetmaster: info: Caching node for <HOSTNAME> info: Could not find class hosttypes::unassigned for <HOSTNAME> notice: Compiled catalog for d<HOSTNAME> in 0.01 seconds info: Caching catalog for <HOSTNAME> -eric On Nov 11, 9:44 am, Eric Snow <es...@verio.net> wrote:> -- puppet.conf -- > > [main] > modulepath = /usr/share/puppet/production/modules > > [development] > modulepath = /usr/share/puppet/development/modules/settings > > [testing] > modulepath = /usr/share/puppet/testing/modules > > [production] > modulepath = /usr/share/puppet/production/modules > > -- /usr/share/puppet/development/modules/settings -- > > settings > |-- all > |-- manifests > |-- init.pp > |-- hosttypes.pp > > -- node (in development) -- > > node test { > include hosttypes::unassigned > > } > > -- init.pp -- > > import "*" > > -- hosttypes.pp -- > > class hosttypes::unassigned { > notify {"hosttypes::unassigned ": } > notice("hosttypes::unassigned ") > service {"httpd": > enable => false, > ensure => stopped, > } > > } > > -- output -- > > /usr/sbin/puppetd --logdest console --test --noop > info: Caching catalog for <HOSTNAME> > info: Applying configuration version ''1289493629'' > notice: Finished catalog run in 0.51 seconds > > The httpd service is enabled and running when this run happens so it > should report the noop. As well, neither the notice nor the notify > happens. This is a simplification, but represents our situation. > > -eric > > On Nov 11, 9:26 am, "R.I.Pienaar" <r...@devco.net> wrote: > > > > > > > > > ----- "Eric Snow" <es...@verio.net> wrote: > > > > Trying to track down why all the modules in my production environment > > > are auto-loaded at the beginning of a run for a node that is in my > > > development environment. The run fails because it cannot find the > > > modules in my development environment which are named differently > > > from > > > production. Makes me think that the wrong ones are getting auto- > > > loaded, or that it is looking for the development modules in the > > > wrong > > > place. > > > would be best if you showed how its set up, file names classes etc-- 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.
R.I.Pienaar
2010-Nov-11 16:50 UTC
Re: [Puppet Users] Re: When do modules get auto-imported
----- "Eric Snow" <esnow@verio.net> wrote:> -- puppet.conf -- > > [main] > modulepath = /usr/share/puppet/production/modules > > [development] > modulepath = /usr/share/puppet/development/modules/settings > > [testing] > modulepath = /usr/share/puppet/testing/modules > > [production] > modulepath = /usr/share/puppet/production/modules > > -- /usr/share/puppet/development/modules/settings -- > > settings > |-- all > |-- manifests > |-- init.pp > |-- hosttypes.pp > > -- node (in development) -- > > node test { > include hosttypes::unassigned > } > > -- init.pp -- > > import "*" > > -- hosttypes.pp -- > > class hosttypes::unassigned { > notify {"hosttypes::unassigned ": } > notice("hosttypes::unassigned ") > service {"httpd": > enable => false, > ensure => stopped, > } > } > > -- output -- > > /usr/sbin/puppetd --logdest console --test --noop > info: Caching catalog for <HOSTNAME> > info: Applying configuration version ''1289493629'' > notice: Finished catalog run in 0.51 seconds > > > The httpd service is enabled and running when this run happens so it > should report the noop. As well, neither the notice nor the notify > happens. This is a simplification, but represents our situation.are you sure the node {} is being loaded? add a notify in the node block to confirm -- 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.
R.I.Pienaar
2010-Nov-11 16:52 UTC
Re: [Puppet Users] Re: When do modules get auto-imported
----- "Eric Snow" <esnow@verio.net> wrote:> On the puppetmaster: > > info: Caching node for <HOSTNAME> > info: Could not find class hosttypes::unassigned for <HOSTNAME> > notice: Compiled catalog for d<HOSTNAME> in 0.01 seconds > info: Caching catalog for <HOSTNAME>ok, disregard previous mail. if you''re including hosttypes::unassigned you need to put the file in either: modulepath/hosttypes/manifests/init.pp or modulepath/hosttypes/manifests/unassigned.pp you cant just put them in any files, it has to know where to find them.> > settings > > |-- all > > |-- manifests > > |-- init.pp > > |-- hosttypes.pp > > > > -- node (in development) -- > > > > node test { > > include hosttypes::unassigned > > > > } > > > > -- init.pp -- > > > > import "*" > > > > -- hosttypes.pp -- > > > > class hosttypes::unassigned { > > notify {"hosttypes::unassigned ": } > > notice("hosttypes::unassigned ") > > service {"httpd": > > enable => false, > > ensure => stopped,-- 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.
Thanks for the feedback. My understanding is that when you have an init.pp with import "*" in it, it will be able to find the rest of the manifests in the module. However, I was operating under the assumption that all the modules in the environment get auto-imported at the beginning of the run (otherwise how are top-level includes found). So is there no way then to have several manifests with their own namespaces bound together in the same module? The alternative (splitting them into their own modules) makes my maintenance duties that much messier. Thanks. -eric On Nov 11, 9:52 am, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > On the puppetmaster: > > > info: Caching node for <HOSTNAME> > > info: Could not find class hosttypes::unassigned for <HOSTNAME> > > notice: Compiled catalog for d<HOSTNAME> in 0.01 seconds > > info: Caching catalog for <HOSTNAME> > > ok, disregard previous mail. > > if you''re including hosttypes::unassigned > > you need to put the file in either: > > modulepath/hosttypes/manifests/init.pp or modulepath/hosttypes/manifests/unassigned.pp > > you cant just put them in any files, it has to know where to find them. > > > > > > > > > > settings > > > |-- all > > > |-- manifests > > > |-- init.pp > > > |-- hosttypes.pp > > > > -- node (in development) -- > > > > node test { > > > include hosttypes::unassigned > > > > } > > > > -- init.pp -- > > > > import "*" > > > > -- hosttypes.pp -- > > > > class hosttypes::unassigned { > > > notify {"hosttypes::unassigned ": } > > > notice("hosttypes::unassigned ") > > > service {"httpd": > > > enable => false, > > > ensure => stopped,-- 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.
R.I.Pienaar
2010-Nov-11 17:33 UTC
Re: [Puppet Users] Re: When do modules get auto-imported
----- "Eric Snow" <esnow@verio.net> wrote:> Thanks for the feedback. > > My understanding is that when you have an init.pp with import "*" in > it, it will be able to find the rest of the manifests in the module. > However, I was operating under the assumption that all the modules in > the environment get auto-imported at the beginning of the run > (otherwise how are top-level includes found).If you dont comply to the module naming conventions - you should - then you have to make import statements in your site.pp or a file directly imported by site.pp to import those files. Else the master just wont know where to find your files. So if class foo is in /some/other/dir/bar.pp you need to have an import statement that specifically hits that file.> So is there no way then to have several manifests with their own > namespaces bound together in the same module? The alternative > (splitting them into their own modules) makes my maintenance duties > that much messier. Thanks.-- 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.
On Thu, Nov 11, 2010 at 9:27 AM, Eric Snow <esnow@verio.net> wrote:> Thanks for the feedback. > > My understanding is that when you have an init.pp with import "*"I would say that in general, if you have to use the import function, it means that you are not organizing things correctly. If modules are used and classes are namespaced and organized correctly, you will never have to use import.> in > it, it will be able to find the rest of the manifests in the module. > However, I was operating under the assumption that all the modules in > the environment get auto-imported at the beginning of the run > (otherwise how are top-level includes found). > > So is there no way then to have several manifests with their own > namespaces bound together in the same module? The alternative > (splitting them into their own modules) makes my maintenance duties > that much messier. Thanks. > > -eric > > On Nov 11, 9:52 am, "R.I.Pienaar" <r...@devco.net> wrote: > > ----- "Eric Snow" <es...@verio.net> wrote: > > > > > On the puppetmaster: > > > > > info: Caching node for <HOSTNAME> > > > info: Could not find class hosttypes::unassigned for <HOSTNAME> > > > notice: Compiled catalog for d<HOSTNAME> in 0.01 seconds > > > info: Caching catalog for <HOSTNAME> > > > > ok, disregard previous mail. > > > > if you''re including hosttypes::unassigned > > > > you need to put the file in either: > > > > modulepath/hosttypes/manifests/init.pp or > modulepath/hosttypes/manifests/unassigned.pp > > > > you cant just put them in any files, it has to know where to find them. > > > > > > > > > > > > > > > > > > settings > > > > |-- all > > > > |-- manifests > > > > |-- init.pp > > > > |-- hosttypes.pp > > > > > > -- node (in development) -- > > > > > > node test { > > > > include hosttypes::unassigned > > > > > > } > > > > > > -- init.pp -- > > > > > > import "*" > > > > > > -- hosttypes.pp -- > > > > > > class hosttypes::unassigned { > > > > notify {"hosttypes::unassigned ": } > > > > notice("hosttypes::unassigned ") > > > > service {"httpd": > > > > enable => false, > > > > ensure => stopped, > > -- > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- 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.
Thanks for the explanation. Sounds like I was way off. -eric On Nov 11, 10:33 am, "R.I.Pienaar" <r...@devco.net> wrote:> ----- "Eric Snow" <es...@verio.net> wrote: > > > Thanks for the feedback. > > > My understanding is that when you have an init.pp with import "*" in > > it, it will be able to find the rest of the manifests in the module. > > However, I was operating under the assumption that all the modules in > > the environment get auto-imported at the beginning of the run > > (otherwise how are top-level includes found). > > If you dont comply to the module naming conventions - you should - then > you have to make import statements in your site.pp or a file directly > imported by site.pp to import those files. Else the master just wont > know where to find your files. > > So if class foo is in /some/other/dir/bar.pp you need to have an import > statement that specifically hits that file. > > > > > > > > > So is there no way then to have several manifests with their own > > namespaces bound together in the same module? The alternative > > (splitting them into their own modules) makes my maintenance duties > > that much messier. Thanks.-- 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.
Okay, so I realized that I had my init.pp file disabled. Once I reenabled it everything worked the way I expected. Once I added more directories to my modulepath then it started having issues again (regardless of the order in my modulepath). Anyway, after this discussion I realized that I need to have an environment specific site.pp and run my settings from there rather than from a module. Thanks for all the feedback. -eric On Nov 11, 10:58 am, Eric Snow <es...@verio.net> wrote:> Thanks for the explanation. Sounds like I was way off. > > -eric > > On Nov 11, 10:33 am, "R.I.Pienaar" <r...@devco.net> wrote: > > > > > > > > > ----- "Eric Snow" <es...@verio.net> wrote: > > > > Thanks for the feedback. > > > > My understanding is that when you have an init.pp with import "*" in > > > it, it will be able to find the rest of the manifests in the module. > > > However, I was operating under the assumption that all the modules in > > > the environment get auto-imported at the beginning of the run > > > (otherwise how are top-level includes found). > > > If you dont comply to the module naming conventions - you should - then > > you have to make import statements in your site.pp or a file directly > > imported by site.pp to import those files. Else the master just wont > > know where to find your files. > > > So if class foo is in /some/other/dir/bar.pp you need to have an import > > statement that specifically hits that file. > > > > So is there no way then to have several manifests with their own > > > namespaces bound together in the same module? The alternative > > > (splitting them into their own modules) makes my maintenance duties > > > that much messier. Thanks.-- 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.