Facility for collecting and capturing/exporting failed/fatal results or entire summary

Is there a facility in Ansible for collecting and capturing/exporting failed/fatal results or the entire summary as a variable, or output to a file?

Basically what I want to be able to do is extract the information about failures from an ansible-playbook run and export them to another process, such as to send the results into an error handler or an alerting system or something like that. I can probably wrap the ansible-playbook job such that I could extract this information to export the results to a variable to pass into another process but this might be a feature that exists and I just haven’t been able to figure out. What’s the recommended way of doing something like this?

Thanks!

In v2.0 there is a stdout_callback configuration option, you could set it to “json” which will load the corresponding plugin. Which would generate an a complete break-down of the run in json format. If you wanted the normal output (called skippy) too, I bet you could subclass/fork the built-in json module and have it write to a file instead into your local callback_plugins directory.

Hopefully this will give you some guidance on options.

Thanks Danny; this looks promising I’ll try it out.