Fix issue when var name is the same as content.

See https://github.com/ansible/ansible/issues/13453 for more details.
pull/13467/head
Yannig Perré 9 years ago committed by James Cammarata
parent d85b8adba6
commit 2ed2c12f60

@ -45,7 +45,11 @@ class ActionModule(ActionBase):
# If var is a list or dict, use the type as key to display
result[to_unicode(type(self._task.args['var']))] = results
else:
# If var name is same as result, try to template it
if results == self._task.args['var']:
try:
results = self._templar.template("{{" + results + "}}", convert_bare=True, fail_on_undefined=True)
except:
results = "VARIABLE IS NOT DEFINED!"
result[self._task.args['var']] = results
else:

Loading…
Cancel
Save