Avoiding common pitfalls
It is vital that your modules are well thought out and handle error conditions gracefully – people are going to rely on your module someday to automate a task on perhaps thousands of servers, and so the last thing they want is to spend significant amounts of time debugging errors, especially trivial ones that could have been trapped or handled gracefully. In this section, we'll look specifically at error handling and ways to do this so that playbooks will still run and exit gracefully.
One piece of overall guidance before we get started is that just like documentation receives a high degree of attention in Ansible, so should your error messages. They should be meaningful and easy to interpret, and you should steer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access