mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fix for saving conditionals in variable expressions.
This commit is contained in:
@@ -528,8 +528,7 @@ class Runner(object):
|
||||
self.conditional = [ self.conditional ]
|
||||
|
||||
for cond in self.conditional:
|
||||
cond = template.template(self.basedir, cond, inject, expand_lists=False)
|
||||
if not utils.check_conditional(cond):
|
||||
if not utils.check_conditional(cond, self.basedir, inject):
|
||||
result = utils.jsonify(dict(changed=False, skipped=True))
|
||||
self.callbacks.on_skipped(host, inject.get('item',None))
|
||||
return ReturnData(host=host, result=result)
|
||||
|
||||
@@ -58,7 +58,7 @@ class ActionModule(object):
|
||||
data = {}
|
||||
data.update(inject)
|
||||
data.update(inject['hostvars'][host])
|
||||
if not check_conditional(template.template(self.runner.basedir, self.runner.conditional, data)):
|
||||
if not check_conditional(self.runner.basedir, self.runner.conditional, data):
|
||||
continue
|
||||
group_name = template.template(self.runner.basedir, args['key'], data)
|
||||
group_name = group_name.replace(' ','-')
|
||||
|
||||
Reference in New Issue
Block a user