From b724f596c46ef9b587eceffc8e8ec62bdc77631a Mon Sep 17 00:00:00 2001 From: Dale Gibson Date: Wed, 23 Oct 2024 21:26:47 +0000 Subject: [PATCH] updated cml_lab_facts to include a topology key with a cml deployable topology yaml object --- plugins/modules/cml_lab_facts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/modules/cml_lab_facts.py b/plugins/modules/cml_lab_facts.py index 6cd7c61..5499ae5 100644 --- a/plugins/modules/cml_lab_facts.py +++ b/plugins/modules/cml_lab_facts.py @@ -63,6 +63,7 @@ from ansible.module_utils.basic import AnsibleModule from ansible_collections.cisco.cml.plugins.module_utils.cml_utils import cmlModule, cml_argument_spec +import yaml def run_module(): @@ -86,6 +87,8 @@ def run_module(): # to handle duplicates lab = labs[0] lab.sync() + topology = lab.download() + cml_facts['topology'] = yaml.safe_load(topology) cml_facts['details'] = lab.details() cml_facts['nodes'] = {} for node in lab.nodes():