mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow debug var parameter to accept a list or dict. Fix https://github.com/ansible/ansible/issues/13252
This commit is contained in:
parent
478c6c756a
commit
0480b44f50
1 changed files with 7 additions and 3 deletions
|
@ -41,6 +41,10 @@ class ActionModule(ActionBase):
|
||||||
# FIXME: move the LOOKUP_REGEX somewhere else
|
# FIXME: move the LOOKUP_REGEX somewhere else
|
||||||
elif 'var' in self._task.args: # and not utils.LOOKUP_REGEX.search(self._task.args['var']):
|
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)
|
||||||
|
if type(self._task.args['var']) in (list, dict):
|
||||||
|
# If var is a list or dict, use the type as key to display
|
||||||
|
result[str(type(self._task.args['var']))] = results
|
||||||
|
else:
|
||||||
if results == self._task.args['var']:
|
if results == self._task.args['var']:
|
||||||
results = "VARIABLE IS NOT DEFINED!"
|
results = "VARIABLE IS NOT DEFINED!"
|
||||||
result[self._task.args['var']] = results
|
result[self._task.args['var']] = results
|
||||||
|
|
Loading…
Reference in a new issue