I am writing a ansible playbook which will gather all the failed count from script and after sum it will display in the report.
For example: shell script fails that is called from the ansible fails with exit 1, 2 for different cases with diff error message after the script runs in different hosts.
I want to gather the total number of failed count(exit 1 + exit 2) and display it in stout. Can I use failed_when and changed_when to achieve this? How do I get the sum?
I want to handle this with in ansible to have a better control rather than in shell script. How can I achieve this?
If it's possible, Can anyone provide a small example to achieve this?
Regards
Pradeep