From 22945050ef0591e529effff9345164d767520312 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Sat, 26 Sep 2015 08:27:02 -0400 Subject: [PATCH] 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 --- playbooks/library/os_ironic_facts.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/playbooks/library/os_ironic_facts.py b/playbooks/library/os_ironic_facts.py index fc2c74e49..7983283ae 100644 --- a/playbooks/library/os_ironic_facts.py +++ b/playbooks/library/os_ironic_facts.py @@ -127,6 +127,13 @@ def main(): if item in facts: 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) else: