mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
mark entire module result untrusted as template (#55717)
* prevents accidental templating on intra-action postprocessing of an untrusted module result * makes the view of a module result within an action consistent with the way it would be stored for future use (eg facts, register)
This commit is contained in:
@@ -968,6 +968,10 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||
data['deprecations'] = []
|
||||
data['deprecations'].extend(self._discovery_deprecation_warnings)
|
||||
|
||||
# mark the entire module results untrusted as a template right here, since the current action could
|
||||
# possibly template one of these values.
|
||||
data = wrap_var(data)
|
||||
|
||||
display.debug("done with _execute_module (%s, %s)" % (module_name, module_args))
|
||||
return data
|
||||
|
||||
@@ -978,9 +982,6 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||
display.warning(w)
|
||||
|
||||
data = json.loads(filtered_output)
|
||||
|
||||
if 'ansible_facts' in data and isinstance(data['ansible_facts'], dict):
|
||||
data['ansible_facts'] = wrap_var(data['ansible_facts'])
|
||||
data['_ansible_parsed'] = True
|
||||
except ValueError:
|
||||
# not valid json, lets try to capture error
|
||||
|
||||
Reference in New Issue
Block a user