mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
This allows variable references in playbooks in a different way.
This commit is contained in:
parent
b5c9d5a59b
commit
90cce35919
3 changed files with 17 additions and 1 deletions
|
@ -49,7 +49,9 @@ class ActionModule(object):
|
|||
else:
|
||||
result = dict(msg=args['msg'])
|
||||
elif 'var' in args:
|
||||
(intermediate, exception) = utils.safe_eval(args['var'], inject, include_exceptions=True, template_call=True)
|
||||
results = utils.safe_eval(args['var'], inject, include_exceptions=True, template_call=True)
|
||||
intermediate = results[0]
|
||||
exception = results[1]
|
||||
if exception is not None:
|
||||
intermediate = "failed to evaluate: %s" % str(exception)
|
||||
result[args['var']] = intermediate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue