mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Merge branch 'only_if-isset' of https://github.com/dhozac/ansible into devel
This commit is contained in:
@@ -335,8 +335,12 @@ class Runner(object):
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user