This allows variable references in playbooks in a different way.

This commit is contained in:
Michael DeHaan 2013-10-30 21:26:16 -04:00
parent b5c9d5a59b
commit 90cce35919
3 changed files with 17 additions and 1 deletions

View file

@ -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