Reputation: 79
How does one use Chef duplicate the Puppet dry-run option to validate whether a machine has the state that matches the recipe(s)?
Upvotes: 2
Views: 199
Reputation: 21
Opscode did come out with their own dry run mode last year, called 'why-run', www.opscode.com/blog/2012/09/07/chef-10-14-0-released/. But you have to be careful as there are limits with the accuracy of all these self-monitoring features, as explained here: http://blog.afistfulofservers.net/post/2012/12/21/promises-lies-and-dryrun-mode/
Using an external tool to verify the current state of a machine against a known good state may be a better option. Check out http://www.metaforsoftware.com/ which will run diff algorithms across large groups of machines so you can see exactly what's changed & missing between them. It's in free beta and we plan to always have a free version. (FD: I'm a co-founder so all caveats apply ;-)
Upvotes: 2
Reputation: 2457
Apparently, you can't. )-:
You can achieve something slightly similar by examining the number of updated resources at the end of a chef-client run using a report handler:
http://wiki.opscode.com/display/chef/Exception+and+Report+Handlers
and a relevant example handler:
http://jtimberman.posterous.com/a-simple-report-handler
However this isn't really a substitute for a --dry-run option where the actions to modify state would not be performed.
Also, it's easy to be lazy write recipes where actions are performed all the time whether they need to or not. This results in the count of updated actions being non-zero in your report handler, but no state has changed on the machine.
Upvotes: 1