Question

If I run a test suite upon install how would I report errors to chef? More generally, are there great packages for verifying system state?

Does this simply involve returning error codes on exit or are there more verbose ways of interacting with Chef?

Was it helpful?

Solution

I highly recommend two tools:

These are great tools for testing the various logic branches and behaviors of your cookbook. ChefSpec will perform an in-memory Chef run, so it's perfect for unit testing and fast feedback loops. Test Kitchen will converge a real node (using Vagrant by default) and then use a busser (such as Bats or Serverspec) to validate the state of the system at the end of converge.

In production, Chef also has native report handling and error reporting. According to the documentation, you can create your own handlers for notifications.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top