added an 'ignore_errors' option to tasks

Failed tasks with ignore_errors=True, allow the remaining tasks in the
play to be executed as if no failure happened. A failure notice is still
written to the output as well as an '...ignoring' message.
This commit is contained in:
Petros Moisiadis 2012-08-01 19:13:07 +03:00
commit 5f4bf813b1
3 changed files with 17 additions and 5 deletions

View file

@ -259,7 +259,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
else:
print "fatal: [%s] => %s" % (host, msg)
def on_failed(self, host, results):
def on_failed(self, host, results, ignore_errors):
item = results.get('item', None)
@ -269,6 +269,8 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
msg = "failed: [%s] => %s" % (host, utils.jsonify(results))
print stringc(msg, 'red')
if ignore_errors:
print stringc("...ignoring", 'yellow')
def on_ok(self, host, host_result):