Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top