mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
Importing re in runner for doing conditional tasks using pattern matching i.e. re.search(). Also conditionally outputting item when skipping.
This commit is contained in:
parent
f8520750cb
commit
4b9b9a8a5b
2 changed files with 6 additions and 2 deletions
|
@ -291,8 +291,11 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
|
|||
else:
|
||||
print >>sys.stderr, "err: [%s] => %s" % (host, err)
|
||||
|
||||
def on_skipped(self, host):
|
||||
def on_skipped(self, host, item=None):
|
||||
|
||||
if item:
|
||||
print "skipping: [%s] => (item=%s)" % (host, item)
|
||||
else:
|
||||
print "skipping: [%s]" % host
|
||||
|
||||
def on_no_hosts(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue