Project

General

Profile

Puppet class browser » History » Version 1

Paul Kelly, 04/19/2010 03:50 PM

1 1 Paul Kelly
h1. Puppet class browser
2
3
There are links labeled "Documentation" on the *settings/puppet classes* page, which will direct your browser to the html documentation for a particular puppet module.
4
5
The documentation is generated by a rake task that uses the puppetdoc utility and may need some customization to work at a particular site.
6
7
h2. Configuration
8
9
h3. Document root
10
11
Ensure that there is an entry in the config/settings.yaml for the document root
12
<pre>
13
:document_root: /var/www
14
</pre>
15
16
The documentation will be written into *document_root*/puppet/rdoc and this location must be in an area that is served by your web server. Any location that is served by apache or webrick/mongrel will do, so foreman's *public* directory is also a suitable candidate.
17
18
h3. manifest cleanup
19
20
The puppetdoc utility is sensitive to the layout of the manifests and modules directories. In particular, it cannot handle circular or broken symlinks. If you have problems running puppetdoc then move *extras/rdoc/rdoc_prepare_script.rb* to *scripts/rdoc_prepare_script.rb* and then edit it to suit your site. Most sites will not require a scripts/rdoc_prepare_script.rb file.
21
22
h2. Generating the documentation.
23
24
h3. Simple case
25
26
This is performed by running
27
28
 rake puppet:rdoc:generate
29
30
h3. Complex case
31
32
When the puppetdoc utility fails to process your manifests then you will have to sanitize your puppet modules directory. The rake puppet:rdoc:generate task will check for the existence of *scripts/rdoc_prepare_script.rb*, and runs this before the the puppetdoc command is executed. This script is expected to copy the source files for your modules to another location, fix any issues and then terminate, passing back the location of the copied directory tree. 
33
34
A fairly complex example is provided in *extras/rdoc/rdoc_prepare_script.rb*. 
35
36
The final command to generate the documentation is then the same as for the simple case
37
38
 rake puppet:rdoc:generate