Do not fail when variable is not correct in debug action.

See https://github.com/ansible/ansible/issues/13484 for more information.
This commit is contained in:
Yannig Perré 2015-12-09 22:08:30 +01:00
parent 64864829c4
commit 18ac12aee6

View file

@ -40,7 +40,7 @@ class ActionModule(ActionBase):
result['msg'] = self._task.args['msg']
# FIXME: move the LOOKUP_REGEX somewhere else
elif 'var' in self._task.args: # and not utils.LOOKUP_REGEX.search(self._task.args['var']):
results = self._templar.template(self._task.args['var'], convert_bare=True)
results = self._templar.template(self._task.args['var'], convert_bare=True, fail_on_undefined=False)
if type(self._task.args['var']) in (list, dict):
# If var is a list or dict, use the type as key to display
result[to_unicode(type(self._task.args['var']))] = results