Hi,
is there any sensible option to make ansible-playbook exit with non-0 exit code if there are any changes to be made to target hosts?
The rationale for this is: we want to start using Jenkins to test if our production infrastructure has not diverged from the state described in Ansible roles and playbooks. It seems to be a good idea to run the playbooks in check mode and report any changes, but apart from parsing the playbook run output with shell tools, we haven’t found (yet) any reasonable solution to only detect (successful) changes and not failures.
It’s quite likely the approach is not really the best and there is some simple and elegant option to achieve the same result (e.g. some Jenkins plugin). We’ll be happy with anything that works; thank you in advance for any ideas and comments