mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-31 17:11:23 -07:00
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:
parent
2d9ceafbd4
commit
5f4bf813b1
3 changed files with 17 additions and 5 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue