mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Reworking internal result flags and making sure include_vars hides vault data
Fixes #10194
This commit is contained in:
parent
eebf437d87
commit
cb262449c7
7 changed files with 30 additions and 27 deletions
|
@ -39,12 +39,13 @@ class ActionModule(ActionBase):
|
|||
source = self._loader.path_dwim(source)
|
||||
|
||||
if os.path.exists(source):
|
||||
data = self._loader.load_from_file(source)
|
||||
(data, show_content) = self._loader._get_file_contents(source)
|
||||
data = self._loader.load(data, show_content)
|
||||
if data is None:
|
||||
data = {}
|
||||
if not isinstance(data, dict):
|
||||
raise AnsibleError("%s must be stored as a dictionary/hash" % source)
|
||||
return dict(ansible_facts=data)
|
||||
return dict(ansible_facts=data, _ansible_no_log=not show_content)
|
||||
else:
|
||||
return dict(failed=True, msg="Source file not found.", file=source)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue