diff --git a/changelogs/fragments/pure_facts_fix.yaml b/changelogs/fragments/pure_facts_fix.yaml new file mode 100644 index 0000000000..4f61b1bcde --- /dev/null +++ b/changelogs/fragments/pure_facts_fix.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: +- purefa_facts and purefb_facts now correctly adds facts into main ansible_fact dictionary (https://github.com/ansible/ansible/pull/50349) diff --git a/lib/ansible/modules/storage/purestorage/purefa_facts.py b/lib/ansible/modules/storage/purestorage/purefa_facts.py index 9f8a6a15b6..f5be249804 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefa_facts.py @@ -675,9 +675,7 @@ def main(): if 'offload' in subset or 'all' in subset: facts['offload'] = generate_offload_dict(array) - result = dict(ansible_purefa_facts=facts,) - - module.exit_json(**result) + module.exit_json(ansible_facts={'ansible_purefa_facts': facts}) if __name__ == '__main__': diff --git a/lib/ansible/modules/storage/purestorage/purefb_facts.py b/lib/ansible/modules/storage/purestorage/purefb_facts.py index 5186961e0a..038131e66e 100644 --- a/lib/ansible/modules/storage/purestorage/purefb_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefb_facts.py @@ -643,9 +643,7 @@ def main(): if 'snapshots' in subset or 'all' in subset: facts['snapshots'] = generate_snap_dict(blade) - result = dict(ansible_purefb_facts=facts,) - - module.exit_json(**result) + module.exit_json(ansible_facts={'ansible_purefb_facts': facts}) if __name__ == '__main__':