ReleaseEngineering/PuppetAgain/HowTo/Hack on PuppetAgain: Difference between revisions

Jump to navigation Jump to search
Line 59: Line 59:
   yum install graphviz
   yum install graphviz
   dot -Tpng /var/lib/puppet/state/graphs/expanded_relationships.dot > relationships.png
   dot -Tpng /var/lib/puppet/state/graphs/expanded_relationships.dot > relationships.png
Note that in current versions of puppet, these are fairly unusable, as they show all relationships as bidirectional.


=== Class Dependencies ===
=== Class Dependencies ===
In general, use ''require => Class['some::class']'' rather than requiring a basic resource that you know the class defines (especially avoid ''require => Package['some-package']'').  This way, you are not depending on an implementation detail of that other class.  This also creates many more dependencies (on all of the concrete resources in that class), which keeps things predictable.
In general, try to use ''require => Class['some::class']'' rather than requiring a basic resource that you know the class defines (especially avoid ''require => Package['some-package']'').  This way, you are not depending on an implementation detail of that other class.  This also creates many more dependencies (on all of the concrete resources in that class), which keeps things predictable.


Unfortunately, these dependencies do *not* extend to included classes.  See [[ReleaseEngineering/PuppetAgain/Anchoring Classes]] for the workaround.  Every class that might be required by another class (which is, more or less, any class documented on the wiki) should be anchored.
Unfortunately, these dependencies do *not* extend to included classes.  See [[ReleaseEngineering/PuppetAgain/Anchoring Classes]] for the workaround.  Every class that can be required by another class (which are explicitly labeled as such in the wiki) should be anchored.


=== Tips ===
=== Tips ===
canmove, Confirmed users
1,394

edits

Navigation menu