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 3604ed0586..a6b5f9bfd8 100644 --- a/lib/ansible/modules/storage/purestorage/purefa_facts.py +++ b/lib/ansible/modules/storage/purestorage/purefa_facts.py @@ -589,9 +589,7 @@ def main(): if 'pgroups' in subset or 'all' in subset: facts['pgroups'] = generate_pgroups_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__':