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:
Timothy Appnel 2012-07-23 19:36:26 -04:00
commit 4b9b9a8a5b
2 changed files with 6 additions and 2 deletions

View file

@ -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):