On Mar 19, 2009, at 3:11 PM, Rob McBroom wrote:

>
> 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.

Imports are parse-time, not compile time.  As Puppet reads the files,  
it evaluates every import immediately.

Please update the documentation to make this clear to your satisfaction.

-- 
'Tis better to be silent and be thought a fool, than to speak and
remove all doubt. --Abraham Lincoln
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to