1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

In playbooks, a return code (rc) of non-zero should fail the playbook.

This commit is contained in:
Michael DeHaan 2012-03-23 20:53:57 -04:00
parent 6ab615c724
commit b43019f3a1

View file

@ -214,7 +214,7 @@ class PlayBook(object):
self.dark[host] = 1 self.dark[host] = 1
for (host, host_result) in contacted_hosts.iteritems(): for (host, host_result) in contacted_hosts.iteritems():
self.processed[host] = 1 self.processed[host] = 1
if 'failed' in host_result: if 'failed' in host_result or (int(host_result.get('rc',0)) != 0):
self.callbacks.on_failed(host, host_result) self.callbacks.on_failed(host, host_result)
self.failures[host] = 1 self.failures[host] = 1
elif 'skipped' in host_result: elif 'skipped' in host_result: