Producing automatic HTML documentation
Like most engineers, I never read the manual, unless and until the product actually catches fire. However, as your manifests get bigger and more complex, it can be helpful to create HTML documentation for your nodes and classes using Puppet's automatic documentation tool, puppet doc
.
How to do it…
Follow these steps to generate HTML documentation for your manifest:
Run the following command:
ubuntu@cookbook:~/puppet$ puppet doc --all --outputdir=/home/ubuntu/puppet/doc --mode rdoc --manifestdir=/home/ubuntu/puppet
This will generate a set of HTML files in
/home/ubuntu/puppet/doc
. Open the top-levelindex.html
file with your web browser, and you'll see something like the following screenshot:
How it works…
puppet doc
creates a structured HTML documentation tree similar to that produced by RDoc
, the popular Ruby documentation generator. This makes it easier to understand how different parts of the manifest relate to one another, as you can click on an included...