Testing and Debugging your puppet configuration
We have been using puppet, for all new server installs here at nominet for a few months now. The idea of course is to simplify the system administration, making us more agile and able to install a particular server with a particular specification far quicker.
It is also designed to give us repeatability, meaning each server “type” we install should be configured in an identical way with the only differences being the uniquely identifying configuration files, which also are controlled via puppet.
It is a paradigm shift I think, and it takes some while to get up to speed with administering a system via puppet rather than traditional methods. However, there are two techniques for testing and debugging your configuration that I have found invaluable. We are using subversion to provide a repository for all our puppet configuration.
Once I have made a change to the configuration and before I have checked this back into subversion I have found the following very useful to run:
puppetmasterd --parseonly --confdir=/var/home/jason/trunk --debug
The parses my configuration that I have checked out to trunk and if it encounters a syntax error in any of the files gives me a file name and line number so I can go debug the issue.
Next up, is when I run the config on the server, it is useful to use the following:
puppetd --debug --test
Somewhat contradictory, this will actually apply the configuration to the system, but runs puppetd just once (rather than every 30 minutes) and provides copious quantities of output so you can spot if your configuration has actually managed to accomplish what you had intended.
I think when you are first getting to grips with puppet, these options can be really useful


May 8th, 2008 at 10:14 am
I ahve found a problem with puppet 0.24.[1-2] where this doesn’t work. The following, however, does work:
puppet –parseonly –confdir=/home/user/svn/puppet/trunk/ –debug /home/user/svn/puppet/trunk/manifests/site.pp
May 8th, 2008 at 8:19 pm
Perfect timing - I’m just working on our first puppet config now!
Rk