Remove excess fact data from being returned to Ansible

The fact module returns ports and links, both of which are unusable
in the ansible user context.  It makes sense to strip them if they
are present.

Change-Id: I663804a8818fb02a8c188ddb7e8944ec1c4a008e
This commit is contained in:
Julia Kreger 2015-09-26 08:27:02 -04:00
parent 37180dff9c
commit 22945050ef

View File

@ -127,6 +127,13 @@ def main():
if item in facts: if item in facts:
del facts[item] del facts[item]
# Remove ports and links as they are useless in the ansible
# use context.
if "ports" in facts:
del facts["ports"]
if "links" in facts:
del facts["links"]
module.exit_json(changed=False, ansible_facts=facts) module.exit_json(changed=False, ansible_facts=facts)
else: else: