diff --git a/plugins/module_utils/network/ios/facts/spanning_tree/spanning_tree.py b/plugins/module_utils/network/ios/facts/spanning_tree/spanning_tree.py index 63dd9f46c..e45597580 100644 --- a/plugins/module_utils/network/ios/facts/spanning_tree/spanning_tree.py +++ b/plugins/module_utils/network/ios/facts/spanning_tree/spanning_tree.py @@ -73,7 +73,7 @@ def populate_facts(self, connection, ansible_facts, data=None): spanning_tree_parser.validate_config(self.argument_spec, {"config": objs}, redact=True), ) - facts["spanning_tree"] = params["config"] + facts["spanning_tree"] = params.get("config", {}) ansible_facts["ansible_network_resources"].update(facts) return ansible_facts