On Friday, November 8, 2013 1:18:04 PM UTC-6, Ken Coar wrote:
>
> Puppet 2.7 (primarily; soon going to 3).
>
> When a host's catalogue is built, Puppet collects all
> the graph nodes first, correct?  And **then** adds the
> dependency edges between them?
>
> Why do I ask?  Because I keep coming up against a desire
> for one class to know whether another one is in the
> catalogue before it declares a dependency relationship.
> defined() doesn't cut it, since the class in question may not
> have been scanned yet.
>
> If it's collect **then** connect, I'll be adding a FREQ for
> a function (or other means) to access/check the collection
> prior to the connexion phase..
>
>

You are wise to avoid defined() here, but I think you would be wiser still 
to give up the whole idea of testing the catalog under construction to 
guide decisions about what (other) resources need to be declared.  It is 
always possible to write your configuration such, though some manifest set 
architectures may lend themselves better to that than do others.

If you have a resource A that you want to declare only if resource B is 
also declared, then the key is to pull up the logic controlling B's 
declaration to encompass the scope of A's declaration as well (which may be 
subject to additional conditions).  The "roles and profiles" pattern is 
well suited to this sort of arrangement, though you can surely find other 
viable approaches as well.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/29272f7b-bfc6-4fd2-8f42-b67a99e68283%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to