Doing a dry run

"No alarms and no surprises."—Radiohead

I hate surprises. 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.

For example, if it would update a config file and restart a production service 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…

Run Puppet with the --noop switch:

# puppet agent --test --noop
info: Connecting to sqlite3 database: /var/lib/puppet/state/clientconfigs.sqlite3 ...

Get Puppet 2.7 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.