Trivially generate dependency graphs for any arbitrary bit of Puppet code (like classes or defined types).
- Graphviz for PNG generation (if
which dot
returns a path, you're good).
Install it as a standalone gem
gem install puppet-graph
Or as part of a bundler managed repo
group :development do
gem 'puppet-graph'
end
Usage: puppet-graph [options]
-c, --code CODE Code to generate a graph of
-f, --fact FACT=VALUE Override a Facter fact
-m, --modulepath PATH The path to your Puppet modules. Defaults to modules/
-o, --output FILE The file to save the graph to
-r, --format FORMAT Output format (png or dot). Optional if your output file ends in .dot or .png
-h, --help Show this help output
-v, --version Show the version
$ puppet-graph -c 'include foo' -o foo.png
$ puppet-graph -c "foo { 'bar': baz => 'gronk' }" -o foo.png
$ puppet-graph -c 'include foo' -f 'operatingsystem=Solaris' -o foo.png