Permalink
Browse files

Merge branch 'only_if-isset' of https://github.com/dhozac/ansible int…

…o devel
  • Loading branch information...
2 parents 4280e00 + 14db2fa commit 862153934146fad7e9841967ac14ca84482a1634 @mpdehaan mpdehaan committed Sep 7, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/ansible/runner/__init__.py
View
6 lib/ansible/runner/__init__.py
@@ -335,8 +335,12 @@ def _executor_internal_inner(self, host, inject, port, is_chained=False):
self.module_args = new_args
self.module_args = utils.template(self.module_args, inject)
+ def _check_conditional(conditional):
+ def isset(var):
+ return not var.startswith("$")
+ return eval(conditional)
conditional = utils.template(self.conditional, inject)
- if not eval(conditional):
+ if not _check_conditional(conditional):
result = utils.jsonify(dict(skipped=True))
self.callbacks.on_skipped(host, inject.get('item',None))
return ReturnData(host=host, result=result)

0 comments on commit 8621539

Please sign in to comment.