On 2009-Mar-19, at 2:20 PM, Gajillion wrote: > My understanding was that the default node was only used when a node > did not match any other way. This appears to be correct for anything > included via "include", however, it appears that anything included via > "import" is pulled in regardless of whether the default node is > matched or not.
I experienced something similar when attempting to use "import" inside a "case" statement. I thought it would be more efficient if the puppetmaster didn't have to evaluate sections that weren't going to get used. (Maybe that's completely wrong.) Anyway, it seems that all "import" lines in your manifests are executed unconditionally. I've taken to just importing absolutely everything at the beginning and then using include to actually load the classes I want. (Most files that get imported contain classes now.) I would also like to hear the official answer on how this is supposed to work. The [documentation][1] says "Code in those external manifests should always be stored in a class or definition or it will be imported into the main scope and applied to all nodes". When I read that, I think "Well, obviously, but only if a particular import statement gets triggered", but maybe it's attempting to warn us that import statements are executed unconditionally? If so, the doc needs to be clarified, IMO. [1]: http://www.reductivelabs.com/trac/puppet/wiki/LanguageTutorial#importing-manifests -- Rob McBroom <http://www.skurfer.com/> Because it screws up the order in which people normally read text. Original message: > Why is it bad to top-post your reply? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
