On Mon, 02 Feb 2015 16:15 -0800, Robb Wagoner <robb.w...@gmail.com>
wrote:
> I have a condition under which I need Ansible to exit without an error
> (i.e. sys.exit(0)). Is there a means by which to do this? I.e. the
> complement to the *fail* module.
That's curious situation. Perhaps you can call ansible this way so the
result of the subshell is always success?
$(ansible-playbook play.yml; exit 0); echo $?
0
After a quick look in the plugins code I don't see a way to hook into
Ansible and change the exit code. If you want to mess with the code
directly, edit ansible-playbook and change the return code in case of
errors. However, it's a non-standard change you'll have to keep track of
between updates.
Giovanni