Rodent of Unusual Size
2013-Nov-08 17:45 UTC
[Puppet Users] Catalogue graph building; nodes *then* edges?
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.. -- Ken Coar Sanagendamgagwedweinini -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/527D2320.7000909%40gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
Ken Coar
2013-Nov-08 19:18 UTC
[Puppet Users] Catalogue graph building; nodes *then* edges?
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.. -- Ken Coar Sanagendamgagwedweinini -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1f1a037d-716b-4ffa-b4f0-1e0781190157%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Nov-11 14:44 UTC
[Puppet Users] Re: Catalogue graph building; nodes *then* edges?
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 puppet-users+unsubscribe@googlegroups.com. 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.
Ken Coar
2013-Nov-11 20:03 UTC
[Puppet Users] Re: Catalogue graph building; nodes *then* edges?
Unfortunately, we have many dozen modules and hundreds of classes, with a disjoint set of people using and maintaining them. What you suggest simply isn''t practical. :-( Asking the human element to keep track of what relevant changes have been made, and alter scripts accordingly, is not only error-prone but the sort of thing computers are supposed to do for us.. Thanks, though! -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/af8023d9-9e42-4d15-bba0-982ca53f2475%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.