diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index 7f8a1692ed..fc8d29162f 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -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): diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 30583a8750..073d273f33 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -31,6 +31,7 @@ import base64 import getpass import codecs import collections +import re import ansible.constants as C import ansible.inventory @@ -548,7 +549,7 @@ class Runner(object): conditional = utils.template(self.conditional, inject) if not eval(conditional): result = utils.jsonify(dict(skipped=True)) - self.callbacks.on_skipped(host) + self.callbacks.on_skipped(host, inject.get('item',None)) return ReturnData(host=host, result=result) conn = None