Doing a dry run
Sometimes your Puppet manifest doesn't do exactly what you expected, or perhaps someone else has checked in changes you didn't know about. Either way, it's good to know exactly what Puppet is going to do before it does it.
If it would update a config
file and restart a production service, for example, this could result in unplanned downtime. Also, sometimes manual configuration changes are made on a server which Puppet would overwrite.
To avoid these problems, you can use Puppet's dry run mode (also called noop mode, for no operation).
How to do it…
Follow this step in order to do a dry run with Puppet. Run Puppet (or the papply
script we wrote in Chapter 1, Puppet Infrastructure) with the --noop
switch. The output will depend on whether Puppet has any changes to make to the machine. If there are resources to be applied, you'll see output similar to this (not the same, of course; the actual output will depend on your manifest):
ubuntu@cookbook:~/puppet$ papply --noop Notice:...