canmove, Confirmed users
1,394
edits
No edit summary |
|||
Line 50: | Line 50: | ||
Wherever a dependency might exist, specify it. Dependency errors are difficult to spot when you're incrementally building a system as you develop your patch. Unspecified dependencies can even work in production -- for a while, until a new and unrelated resource shakes up the ordering and suddenly things don't work. | Wherever a dependency might exist, specify it. Dependency errors are difficult to spot when you're incrementally building a system as you develop your patch. Unspecified dependencies can even work in production -- for a while, until a new and unrelated resource shakes up the ordering and suddenly things don't work. | ||
You can get puppet to give you a dependency graph in .dot format! See http://bitfieldconsulting.com/puppet-dependency-graphs | You can get puppet to give you a dependency graph in .dot format! See http://bitfieldconsulting.com/puppet-dependency-graphs - although the results are enormous: | ||
yum install graphviz | |||
dot -Tpng /var/lib/puppet/state/graphs/expanded_relationships.dot > relationships.png | |||
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 resources in that class), which keeps things predictable. | 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 resources in that class), which keeps things predictable. |