From b50fde8ade826886488cc1230517c745948af28f Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Wed, 20 Nov 2024 19:25:00 +0530 Subject: [PATCH 01/20] Fix the issue of verifying the deletion of template or project --- plugins/modules/template_workflow_manager.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 2f2820567..ec1b97375 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -3371,7 +3371,7 @@ def delete_project_or_template(self, config, is_delete_project=False): template_params = self.want.get("template_params") params_key = {"template_id": self.have_template.get("id")} deletion_value = "deletes_the_template" - name = "templateName: {0}".format(template_params.get('templateName')) + name = "templateName: {0}".format(template_params.get('name')) response = self.dnac_apply['exec']( family="configuration_templates", @@ -3474,8 +3474,7 @@ def get_diff_deleted(self, config): ).format(template_name) self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() - self.msg = "Successfully completed delete state execution" - self.status = "success" + self.log("Successfully completed delete state execution", "DEBUG") return self def verify_diff_merged(self, config): @@ -3570,15 +3569,11 @@ def verify_diff_deleted(self, config): "name", templateName) if template_info: - self.msg = "Configuration Template config is not applied to the Cisco Catalyst Center." - self.status = "failed" + self.log("Configuration Template config is not applied to the Cisco Catalyst Center.", "WARNING") return self - self.log("Successfully validated absence of template in the Catalyst Center.", "INFO") - self.result['response'][0].get("configurationTemplate").get("response").update({"Validation": "Success"}) + self.log("Successfully validated the absence of Template in the Cisco Catalyst Center.", "INFO") - self.msg = "Successfully validated the absence of Template in the Cisco Catalyst Center." - self.status = "success" return self def reset_values(self): From f4bb5d7af490e20fd403a80b46bf9fd487c2c002 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 21 Nov 2024 16:00:15 +0530 Subject: [PATCH 02/20] address review comments --- plugins/modules/template_workflow_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index ec1b97375..0835b7220 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -3464,6 +3464,7 @@ def get_diff_deleted(self, config): self.msg = "Project is not deletable" self.status = "failed" return self + self.log("Successfully completed the delete operation for the template {0}".format(templateName), "DEBUG") deploy_temp_details = config.get("deploy_template") if deploy_temp_details: @@ -3474,7 +3475,6 @@ def get_diff_deleted(self, config): ).format(template_name) self.set_operation_result("failed", False, self.msg, "ERROR").check_return_status() - self.log("Successfully completed delete state execution", "DEBUG") return self def verify_diff_merged(self, config): @@ -3572,7 +3572,7 @@ def verify_diff_deleted(self, config): self.log("Configuration Template config is not applied to the Cisco Catalyst Center.", "WARNING") return self - self.log("Successfully validated the absence of Template in the Cisco Catalyst Center.", "INFO") + self.log("Successfully validated the absence of Template {0} in the Cisco Catalyst Center.".format(templateName), "INFO") return self From 7d856533d4a002fa45abc7a9946fd5f5ec84caa4 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 21 Nov 2024 17:11:55 +0530 Subject: [PATCH 03/20] revert the version in galaxy.yml --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 935f754c0..c08001f0a 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: cisco name: dnac -version: 6.24.0 +version: 6.25.1 readme: README.md authors: - Rafael Campos From becc28443c0ccff54d44d2c9b72497b6222430a9 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 21 Nov 2024 17:21:16 +0530 Subject: [PATCH 04/20] revert the import statements after documentation --- plugins/modules/template_workflow_manager.py | 22 ++++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 55e8f3d46..df0bd7b62 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -6,17 +6,6 @@ """Ansible module to perform operations on project and templates in Cisco Catalyst Center.""" from __future__ import absolute_import, division, print_function -from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( - DnacBase, - validate_list_of_dicts, - get_dict_result, - dnac_compare_equality, -) -from ansible.module_utils.basic import AnsibleModule -import time -import json -import copy - __metaclass__ = type __author__ = [ 'Madhan Sankaranarayanan, Rishita Chowdhary, Akash Bhaskaran, Muthu Rakesh, Abhishek Maheshwari'] @@ -1186,6 +1175,17 @@ """ +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DnacBase, + validate_list_of_dicts, + get_dict_result, + dnac_compare_equality, +) +from ansible.module_utils.basic import AnsibleModule +import time +import json +import copy + class Template(DnacBase): """Class containing member attributes for template_workflow_manager module""" From 9287475f5c21e248a647ed4dad2057c798344d52 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Mon, 25 Nov 2024 11:12:35 +0530 Subject: [PATCH 05/20] moved import to the top of the module --- plugins/modules/template_workflow_manager.py | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index df0bd7b62..5f05c132e 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -6,6 +6,16 @@ """Ansible module to perform operations on project and templates in Cisco Catalyst Center.""" from __future__ import absolute_import, division, print_function +from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( + DnacBase, + validate_list_of_dicts, + get_dict_result, + dnac_compare_equality, +) +from ansible.module_utils.basic import AnsibleModule +import time +import json +import copy __metaclass__ = type __author__ = [ 'Madhan Sankaranarayanan, Rishita Chowdhary, Akash Bhaskaran, Muthu Rakesh, Abhishek Maheshwari'] @@ -1175,17 +1185,6 @@ """ -from ansible_collections.cisco.dnac.plugins.module_utils.dnac import ( - DnacBase, - validate_list_of_dicts, - get_dict_result, - dnac_compare_equality, -) -from ansible.module_utils.basic import AnsibleModule -import time -import json -import copy - class Template(DnacBase): """Class containing member attributes for template_workflow_manager module""" From b54365cf6a5c1ad9c2ebeee631ed1aa4395419aa Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Mon, 25 Nov 2024 11:14:38 +0530 Subject: [PATCH 06/20] add new line after import statements --- plugins/modules/template_workflow_manager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 5f05c132e..55e8f3d46 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -16,6 +16,7 @@ import time import json import copy + __metaclass__ = type __author__ = [ 'Madhan Sankaranarayanan, Rishita Chowdhary, Akash Bhaskaran, Muthu Rakesh, Abhishek Maheshwari'] From af9895f1d6d8af554f5b49cda0e3d86d05231e67 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Mon, 25 Nov 2024 12:52:23 +0530 Subject: [PATCH 07/20] add quotes to the variable --- plugins/modules/template_workflow_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 55e8f3d46..8eca38311 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -2927,7 +2927,7 @@ def filter_devices_with_family_role( filtered_device_list = [] self.log( - "Filtering devices from the provided site-assigned device IDs: {0}, device_family='{1}', " + "Filtering devices from the provided site-assigned device IDs: '{0}', device_family='{1}', " "and device_role='{2}'".format( site_assign_device_ids, device_family, From 24d5b76e88b2ac484d3613de425720d0e3353ed8 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Mon, 25 Nov 2024 12:54:14 +0530 Subject: [PATCH 08/20] Revert "add new line after import statements" This reverts commit b54365cf6a5c1ad9c2ebeee631ed1aa4395419aa. --- plugins/modules/template_workflow_manager.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 8eca38311..037568fa3 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -16,7 +16,6 @@ import time import json import copy - __metaclass__ = type __author__ = [ 'Madhan Sankaranarayanan, Rishita Chowdhary, Akash Bhaskaran, Muthu Rakesh, Abhishek Maheshwari'] From 358c7c6e7f4668ccd807dfafa437c0d0b5cc7ea1 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Mon, 25 Nov 2024 12:57:23 +0530 Subject: [PATCH 09/20] revert 2 commits before --- plugins/modules/template_workflow_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 037568fa3..55e8f3d46 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -16,6 +16,7 @@ import time import json import copy + __metaclass__ = type __author__ = [ 'Madhan Sankaranarayanan, Rishita Chowdhary, Akash Bhaskaran, Muthu Rakesh, Abhishek Maheshwari'] @@ -2926,7 +2927,7 @@ def filter_devices_with_family_role( filtered_device_list = [] self.log( - "Filtering devices from the provided site-assigned device IDs: '{0}', device_family='{1}', " + "Filtering devices from the provided site-assigned device IDs: {0}, device_family='{1}', " "and device_role='{2}'".format( site_assign_device_ids, device_family, From 52d6207c569fece4404c8d7276fa77cef399a1d6 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Wed, 27 Nov 2024 10:13:34 +0530 Subject: [PATCH 10/20] Fix the issue of creating fabric sites/zones in single go --- .../sda_fabric_sites_zones_workflow_manager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py index 50e6fb4de..040b13585 100644 --- a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py +++ b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py @@ -1449,11 +1449,15 @@ def get_diff_merged(self, config): # Create/Update Fabric sites/zones in Cisco Catalyst Center raw_fabric_sites = self.want.get('fabric_sites') - # Convert each dictionary to a sorted tuple of key-value pairs - unique_fabric_sites = {tuple(sorted(d.items())) - for d in raw_fabric_sites} - # Convert each unique tuple back into a dictionary - fabric_sites = [dict(t) for t in unique_fabric_sites] + # Preserve the order of input while deduplicating + unique_fabric_site_set = set() + fabric_sites = [] + for fabric_site_dict in raw_fabric_sites: + # Convert dictionary to a frozenset - immutable set + site_zone = frozenset(fabric_site_dict.items()) + if site_zone not in unique_fabric_site_set: + unique_fabric_site_set.add(site_zone) + fabric_sites.append(fabric_site_dict) for site in fabric_sites: site_name = site.get("site_name_hierarchy") From bcf46d868d493809381bd96e6ccd8969ad12c72b Mon Sep 17 00:00:00 2001 From: MUTHU-RAKESH-27 <19cs127@psgitech.ac.in> Date: Thu, 28 Nov 2024 10:11:08 +0530 Subject: [PATCH 11/20] Corrected the misleading documentation and handled error for non-existing fabric site --- .../modules/sda_fabric_devices_workflow_manager.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/modules/sda_fabric_devices_workflow_manager.py b/plugins/modules/sda_fabric_devices_workflow_manager.py index ba0a7085a..65b019005 100644 --- a/plugins/modules/sda_fabric_devices_workflow_manager.py +++ b/plugins/modules/sda_fabric_devices_workflow_manager.py @@ -103,8 +103,7 @@ to advertise and manage routing information within LISP networks. choices: [LISP_BGP, LISP_PUB_SUB] default: LISP_BGP - type: list - elements: str + type: str borders_settings: description: - Effective only when the 'device_roles' contains BORDER_NODE. @@ -529,7 +528,7 @@ external_connectivity_ip_pool_name: Reserved_sda_test_1 virtual_network_name: L3VN1 vlan_id: 440 - tcp_mss_adjustment: 2 + tcp_mss_adjustment: 501 - name: Add L3 Handoff with IP Transit to the SDA fabric device with local and remote network cisco.dnac.sda_fabric_devices_workflow_manager: @@ -2174,6 +2173,12 @@ def get_have_fabric_devices(self, fabric_devices): "The provided 'fabric_name' '{fabric_name}' is not valid a fabric site." .format(fabric_name=fabric_name) ) + if self.params.get("state") == "deleted": + self.log(self.msg, "INFO") + self.result.get("response").append({"msg": self.msg}) + self.status = "exited" + return self + self.log(self.msg, "ERROR") self.status = "failed" return self From 5c2c660c145ffd3dab53c9199885a590570e8150 Mon Sep 17 00:00:00 2001 From: MUTHU-RAKESH-27 <19cs127@psgitech.ac.in> Date: Thu, 28 Nov 2024 10:26:13 +0530 Subject: [PATCH 12/20] Resolved the sanity issues --- plugins/modules/sda_fabric_devices_workflow_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/sda_fabric_devices_workflow_manager.py b/plugins/modules/sda_fabric_devices_workflow_manager.py index 65b019005..884ffb733 100644 --- a/plugins/modules/sda_fabric_devices_workflow_manager.py +++ b/plugins/modules/sda_fabric_devices_workflow_manager.py @@ -30,7 +30,7 @@ state: description: The state of Cisco Catalyst Center after module completion. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: @@ -195,7 +195,7 @@ - Unique identifier assigned to a Virtual Local Area Network (VLAN). - Should be unique across the entire fabric site settings. - The 'vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. - - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. + - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. - This parameter cannot be updated once set. type: int tcp_mss_adjustment: From 669bc8efe7b3eb8a560f2c9821fc0daf7860fe02 Mon Sep 17 00:00:00 2001 From: MUTHU-RAKESH-27 <19cs127@psgitech.ac.in> Date: Thu, 28 Nov 2024 12:34:36 +0530 Subject: [PATCH 13/20] Resolved the sanity issues --- .../sda_fabric_devices_workflow_manager.py | 300 +++++++++--------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/plugins/modules/sda_fabric_devices_workflow_manager.py b/plugins/modules/sda_fabric_devices_workflow_manager.py index 884ffb733..97c37a369 100644 --- a/plugins/modules/sda_fabric_devices_workflow_manager.py +++ b/plugins/modules/sda_fabric_devices_workflow_manager.py @@ -13,10 +13,10 @@ module: sda_fabric_devices_workflow_manager short_description: Manage SDA fabric devices in Cisco Catalyst Center. description: -- Perform operations on SDA fabric devices, including adding, updating, and deleting fabric devices. -- Manage L2 handoffs for fabric devices, including adding and deleting configurations. -- Manage L3 handoffs for fabric devices with IP transit, including adding, updating, and deleting configurations. -- Manage L3 handoffs for fabric devices with SDA transit, including adding, updating, and deleting configurations. + - Perform operations on SDA fabric devices, including adding, updating, and deleting fabric devices. + - Manage L2 handoffs for fabric devices, including adding and deleting configurations. + - Manage L3 handoffs for fabric devices with IP transit, including adding, updating, and deleting configurations. + - Manage L3 handoffs for fabric devices with SDA transit, including adding, updating, and deleting configurations. version_added: '6.21.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -26,7 +26,7 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center after applying the playbook config. type: bool - default: False + default: false state: description: The state of Cisco Catalyst Center after module completion. type: str @@ -34,8 +34,8 @@ default: merged config: description: - - A list of SDA fabric device configurations associated with fabric sites. - - Each entry in the list represents the configurations for devices within a fabric site. + - A list of SDA fabric device configurations associated with fabric sites. + - Each entry in the list represents the configurations for devices within a fabric site. type: list elements: dict required: true @@ -46,12 +46,12 @@ suboptions: fabric_name: description: - - Name of the SDA fabric site. - - Mandatory parameter for all operations under fabric_devices. - - The fabric site must already be created before configuring devices. - - A Fabric Site is composed of networking devices operating in SD-Access Fabric roles. - - A fabric site consists of networking devices in SD-Access Fabric roles, including Border Nodes, Control Plane Nodes, and Edge Nodes. - - A Fabric sites may also include Fabric Wireless LAN Controllers and Fabric Wireless Access Points. + - Name of the SDA fabric site. + - Mandatory parameter for all operations under fabric_devices. + - The fabric site must already be created before configuring devices. + - A Fabric Site is composed of networking devices operating in SD-Access Fabric roles. + - A fabric site consists of networking devices in SD-Access Fabric roles, including Border Nodes, Control Plane Nodes, and Edge Nodes. + - A Fabric sites may also include Fabric Wireless LAN Controllers and Fabric Wireless Access Points. type: str required: true device_config: @@ -63,54 +63,54 @@ suboptions: device_ip: description: - - IP address of the device to be added to the fabric site. - - Mandatory parameter for all operations under fabric_devices. - - Device must be provisioned to the site prior to configuration. + - IP address of the device to be added to the fabric site. + - Mandatory parameter for all operations under fabric_devices. + - Device must be provisioned to the site prior to configuration. type: str required: true delete_fabric_device: description: - - Effective only when the state is deleted. - - Set to true to delete the device from the fabric site, or false to retain it. + - Effective only when the state is deleted. + - Set to true to delete the device from the fabric site, or false to retain it. type: bool device_roles: description: - - Specifies the role(s) of the device within the fabric site. - - This parameter is required when adding the device to the fabric site. - - The device roles cannot be updated once assigned. - - At least one device must be a CONTROL_PLANE_NODE to assign roles to other devices. - - Available roles, - - CONTROL_PLANE_NODE - Manages the mapping of endpoint IP addresses to their location - within the network using LISP, enabling mobility. - - EDGE_NODE - Connects endpoints to the SDA network, handling policy enforcement, - segmentation, and communication with the control plane. - - BORDER_NODE - Acts as the gateway between the fabric and external networks, - managing traffic entering or exiting the SDA environment. - - WIRELESS_CONTROLLER_NODE - Manages and controls wireless access points and - devices within the network. - - For 'WIRELESS_CONTROLLER_NODE', the check for the provisioning status will be added in 2.3.7.6 SDK. + - Specifies the role(s) of the device within the fabric site. + - This parameter is required when adding the device to the fabric site. + - The device roles cannot be updated once assigned. + - At least one device must be a CONTROL_PLANE_NODE to assign roles to other devices. + - Available roles, + - CONTROL_PLANE_NODE - Manages the mapping of endpoint IP addresses to their location + within the network using LISP, enabling mobility. + - EDGE_NODE - Connects endpoints to the SDA network, handling policy enforcement, + segmentation, and communication with the control plane. + - BORDER_NODE - Acts as the gateway between the fabric and external networks, + managing traffic entering or exiting the SDA environment. + - WIRELESS_CONTROLLER_NODE - Manages and controls wireless access points and + devices within the network. + - For 'WIRELESS_CONTROLLER_NODE', the check for the provisioning status will be added in 2.3.7.6 SDK. choices: [CONTROL_PLANE_NODE, EDGE_NODE, BORDER_NODE, WIRELESS_CONTROLLER_NODE] type: list elements: str route_distribution_protocol: description: - - Specifies the Route Distribution Protocol for the Control Plane Device. - - The route distribution protocol manages routing information across network segments. - - Available protocols, - - LISP_BGP - Location/ID Separation Protocol with a publish-subscribe mechanism - for distributing routing information. - - LISP_PUB_SUB - Location/ID Separation Protocol with BGP, where BGP serves as the control plane - to advertise and manage routing information within LISP networks. + - Specifies the Route Distribution Protocol for the Control Plane Device. + - The route distribution protocol manages routing information across network segments. + - Available protocols, + - LISP_BGP - Location/ID Separation Protocol with a publish-subscribe mechanism + for distributing routing information. + - LISP_PUB_SUB - Location/ID Separation Protocol with BGP, where BGP serves as the control plane + to advertise and manage routing information within LISP networks. choices: [LISP_BGP, LISP_PUB_SUB] default: LISP_BGP type: str borders_settings: description: - - Effective only when the 'device_roles' contains BORDER_NODE. - - This parameter is required when adding the device to a fabric site with the `BORDER_NODE` role. - - Updates to `borders_settings` are allowed after the initial configuration. - - Border type can be Layer2 or Layer3. - - Border type can be Layer2 or Layer3, identified based on the presence of L2 Handoff or L3 Handoff with IP or SDA transit. + - Effective only when the 'device_roles' contains BORDER_NODE. + - This parameter is required when adding the device to a fabric site with the `BORDER_NODE` role. + - Updates to `borders_settings` are allowed after the initial configuration. + - Border type can be Layer2 or Layer3. + - Border type can be Layer2 or Layer3, identified based on the presence of L2 Handoff or L3 Handoff with IP or SDA transit. type: dict suboptions: layer3_settings: @@ -120,201 +120,201 @@ suboptions: local_autonomous_system_number: description: - - Identifies the local autonomous system in BGP routing. - - This parameter is required when adding a device with the `BORDER_NODE` role. - - The `local_autonomous_system_number` cannot be updated once set. - - Acceptable range is from 1 to 4,294,967,295. - - Dot notation (1.0 to 65535.65535) is also allowed. For example, 65534.65535. + - Identifies the local autonomous system in BGP routing. + - This parameter is required when adding a device with the `BORDER_NODE` role. + - The `local_autonomous_system_number` cannot be updated once set. + - Acceptable range is from 1 to 4,294,967,295. + - Dot notation (1.0 to 65535.65535) is also allowed. For example, 65534.65535. type: str is_default_exit: description: - - Indicates whether this Border Node serves as the default gateway for traffic exiting the virtual network. - - The `is_default_exit` cannot be updated. + - Indicates whether this Border Node serves as the default gateway for traffic exiting the virtual network. + - The `is_default_exit` cannot be updated. type: bool default: true import_external_routes: description: - - Determines whether routes from external networks are imported into the fabric. - - Enhances security by limiting route usage to internal routes. - - The 'import_external_routes' cannot be updated. + - Determines whether routes from external networks are imported into the fabric. + - Enhances security by limiting route usage to internal routes. + - The 'import_external_routes' cannot be updated. type: bool default: true border_priority: description: - - Sets the preference level for this Border Node when multiple border nodes are present. - - Higher-priority nodes are favored for routing traffic to external networks. - - Acceptable range is from 1 to 9. If not set, the default value is 10. - - This parameter can be updated. + - Sets the preference level for this Border Node when multiple border nodes are present. + - Higher-priority nodes are favored for routing traffic to external networks. + - Acceptable range is from 1 to 9. If not set, the default value is 10. + - This parameter can be updated. type: int default: 10 prepend_autonomous_system_count: description: - - Increases the AS path length artificially when advertising routes via BGP. - - It makes the route less attractive to external peers. - - Acceptable range is from 1 to 10. If not set, the default value is 0. - - This parameter can be updated. + - Increases the AS path length artificially when advertising routes via BGP. + - It makes the route less attractive to external peers. + - Acceptable range is from 1 to 10. If not set, the default value is 0. + - This parameter can be updated. type: int default: 0 layer3_handoff_ip_transit: description: - - Adds layer 3 handoffs with ip transit in fabric devices. - - Configured when IP traffic is routed from the SDA fabric to external networks. - - If 'layer3_handoff_ip_transit' is set, border type will be considered as Layer3. + - Adds layer 3 handoffs with ip transit in fabric devices. + - Configured when IP traffic is routed from the SDA fabric to external networks. + - If 'layer3_handoff_ip_transit' is set, border type will be considered as Layer3. type: list elements: dict suboptions: transit_network_name: description: - - Network that connects multiple SDA fabrics or networks. - - Required for all operations in L3 Handoff with IP transit. - - It is not possible to update `transit_network_name` after initial configuration. + - Network that connects multiple SDA fabrics or networks. + - Required for all operations in L3 Handoff with IP transit. + - It is not possible to update `transit_network_name` after initial configuration. type: str interface_name: description: - - Refers to the specific network interface in the border device. - - This parameter is required for all operations in L3 Handoff with IP transit. - - This parameter cannot be updated after being set. + - Refers to the specific network interface in the border device. + - This parameter is required for all operations in L3 Handoff with IP transit. + - This parameter cannot be updated after being set. type: str external_connectivity_ip_pool_name: description: - - Denotes the IP address range allocated for communication between the SDA fabric and external networks. - - This parameter is required for adding the L3 Handoff with IP transit. - - The IP pool must be reserved in the fabric site. - - If `external_connectivity_ip_pool_name` is specified, there is no need to set the local and remote addresses. - - Specifying `external_connectivity_ip_pool_name` will automatically configure the local and remote addresses. - - If both are set, `external_connectivity_ip_pool_name` takes precedence. - - Updating IP addresses is not permitted. + - Denotes the IP address range allocated for communication between the SDA fabric and external networks. + - This parameter is required for adding the L3 Handoff with IP transit. + - The IP pool must be reserved in the fabric site. + - If `external_connectivity_ip_pool_name` is specified, there is no need to set the local and remote addresses. + - Specifying `external_connectivity_ip_pool_name` will automatically configure the local and remote addresses. + - If both are set, `external_connectivity_ip_pool_name` takes precedence. + - Updating IP addresses is not permitted. type: str virtual_network_name: description: - - Refers to the logical segmentation of the network, grouping devices into isolated virtual networks. - - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. + - Refers to the logical segmentation of the network, grouping devices into isolated virtual networks. + - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. type: str vlan_id: description: - - Unique identifier assigned to a Virtual Local Area Network (VLAN). - - Should be unique across the entire fabric site settings. - - The 'vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. - - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. - - This parameter cannot be updated once set. + - Unique identifier assigned to a Virtual Local Area Network (VLAN). + - Should be unique across the entire fabric site settings. + - The 'vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Either `virtual_network_name` or `vlan_id` is required for all operations in L3 Handoff with IP transit. + - This parameter cannot be updated once set. type: int tcp_mss_adjustment: description: - - Allows the modification of the Maximum Segment Size in TCP packets. - - The 'tcp_mss_adjustment' can be set from 500 to 1440. - - This parameter can be updated after being initially set. + - Allows the modification of the Maximum Segment Size in TCP packets. + - The 'tcp_mss_adjustment' can be set from 500 to 1440. + - This parameter can be updated after being initially set. type: int local_ip_address: description: - - IP address assigned to a device's interface within the fabric. - - The 'local_ip_address' is for IPv4. - - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. - - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address assigned to a device's interface within the fabric. + - The 'local_ip_address' is for IPv4. + - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. + - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str remote_ip_address: description: - - IP address of a device located outside the fabric network, often used for BGP peering. - - The 'remote_ip_address' is for IPv4. - - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. - - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address of a device located outside the fabric network, often used for BGP peering. + - The 'remote_ip_address' is for IPv4. + - Both 'local_ip_address' and 'remote_ip_address' must fall within the same subnet. + - Either local and remote addresses or `external_connectivity_ip_pool_name` is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str local_ipv6_address: description: - - IP address assigned to a device's interface within the fabric. - - The local_ipv6_address is for IPv6. - - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. - - If 'remote_ipv6_address' is provided, then 'local_ipv6_address' is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address assigned to a device's interface within the fabric. + - The local_ipv6_address is for IPv6. + - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. + - If 'remote_ipv6_address' is provided, then 'local_ipv6_address' is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str remote_ipv6_address: description: - - IP address of a device located outside the fabric network, often used for BGP peering. - - The 'remote_ipv6_address' is for IPv6. - - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. - - If 'local_ipv6_address' is provided, then 'remote_ipv6_address' is required. - - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', - `external_connectivity_ip_pool_name` takes precedence. + - IP address of a device located outside the fabric network, often used for BGP peering. + - The 'remote_ipv6_address' is for IPv6. + - Both 'local_ipv6_address' and 'remote_ipv6_address' must fall within the same subnet. + - If 'local_ipv6_address' is provided, then 'remote_ipv6_address' is required. + - If local and remote addresses are provided with 'external_connectivity_ip_pool_name', + `external_connectivity_ip_pool_name` takes precedence. type: str layer3_handoff_sda_transit: description: - - Adds layer 3 handoffs with SDA transit in fabric devices. - - Configured when routing traffic is routed from the SDA fabric to external networks. - - If 'layer3_handoff_sda_transit' is set, border type will be considered as Layer3. + - Adds layer 3 handoffs with SDA transit in fabric devices. + - Configured when routing traffic is routed from the SDA fabric to external networks. + - If 'layer3_handoff_sda_transit' is set, border type will be considered as Layer3. type: dict suboptions: transit_network_name: description: - - Network that connects multiple SDA fabrics or networks. - - This parameter is required for all operations in L3 Handoff with SDA transit. - - The transit_network_name cannot be updated. + - Network that connects multiple SDA fabrics or networks. + - This parameter is required for all operations in L3 Handoff with SDA transit. + - The transit_network_name cannot be updated. type: str affinity_id_prime: description: - - It supersedes the border priority to determine border node preference. - - The lower the relative value of 'affinity_id_prime', the higher the preference. - - Resources with the same affinity ID are treated similarly and affinity_id_decider decides the priority. - - The 'affinity_id_prime' ranges from 0 to 2147483647. - - The 'affinity_id_prime' can be updated. + - It supersedes the border priority to determine border node preference. + - The lower the relative value of 'affinity_id_prime', the higher the preference. + - Resources with the same affinity ID are treated similarly and affinity_id_decider decides the priority. + - The 'affinity_id_prime' ranges from 0 to 2147483647. + - The 'affinity_id_prime' can be updated. type: int affinity_id_decider: description: - - If the 'affinity_id_prime' value is the same, the 'affinity_id_decider' value is used as a tiebreaker. - - The lower the relative value of 'affinity_id_decider', the higher the preference. - - The 'affinity_id_decider' ranges from 0 to 2147483647. - - The 'affinity_id_decider' can be updated. + - If the 'affinity_id_prime' value is the same, the 'affinity_id_decider' value is used as a tiebreaker. + - The lower the relative value of 'affinity_id_decider', the higher the preference. + - The 'affinity_id_decider' ranges from 0 to 2147483647. + - The 'affinity_id_decider' can be updated. type: int connected_to_internet: description: - - Set this true to allow associated site to provide internet access to other sites through SDA. - - Default value is false. - - This parameter can be updated. + - Set this true to allow associated site to provide internet access to other sites through SDA. + - Default value is false. + - This parameter can be updated. type: bool default: false is_multicast_over_transit_enabled: description: - - Set this true to configure native multicast over multiple sites that are connected to an SDA transit. - - Default value is false. - - This parameter can be updated. + - Set this true to configure native multicast over multiple sites that are connected to an SDA transit. + - Default value is false. + - This parameter can be updated. type: bool default: false layer2_handoff: description: - - Adds layer 2 handoffs in fabric devices. - - This parameter cannots be updated. - - Configured while transferring a device's data traffic at Layer 2 (Data Link layer). - - If 'layer2_handoff' is set, the border type will be considered as Layer2. + - Adds layer 2 handoffs in fabric devices. + - This parameter cannots be updated. + - Configured while transferring a device's data traffic at Layer 2 (Data Link layer). + - If 'layer2_handoff' is set, the border type will be considered as Layer2. type: list elements: dict suboptions: interface_name: description: - - Refers to the specific network interface in the border device. - - This parameter is required for all operations in L2 Handoff. - - The 'interface_name' cannot be updated. + - Refers to the specific network interface in the border device. + - This parameter is required for all operations in L2 Handoff. + - The 'interface_name' cannot be updated. type: str internal_vlan_id: description: - - Represents the VLAN identifier used within the fabric for traffic segmentation among devices. - - Should be unique across the entire fabric site settings. - - This parameter is required for all operations in layer2_handoff. - - The 'internal_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Represents the VLAN identifier used within the fabric for traffic segmentation among devices. + - Should be unique across the entire fabric site settings. + - This parameter is required for all operations in layer2_handoff. + - The 'internal_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. type: int external_vlan_id: description: - - Represents to the VLAN identifier used for traffic that exits the fabric to external networks. - - Should be unique across the entire fabric site settings. - - This parameter is required for all operations in 'layer2_handoff'. - - The 'external_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. + - Represents to the VLAN identifier used for traffic that exits the fabric to external networks. + - Should be unique across the entire fabric site settings. + - This parameter is required for all operations in 'layer2_handoff'. + - The 'external_vlan_id' can range from 1 to 4094, excluding 1, 1002-1005, 2046, and 4094. type: int requirements: -- dnacentersdk >= 2.9.2 -- python >= 3.9 + - dnacentersdk >= 2.9.2 + - python >= 3.9 notes: - SDK Method used are site_design.SiteDesign.get_sites, From b63863043ed43b65b7927cc621e6f31b17b752db Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 14:41:32 +0530 Subject: [PATCH 14/20] Add space after - to fix sanity errors --- plugins/modules/template_workflow_manager.py | 72 ++++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 0835b7220..32ab9c9ae 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -14,14 +14,14 @@ module: template_workflow_manager short_description: Resource module for Template functions description: -- Manage operations create, update and delete of the resource Configuration Template. -- API to create a template by project name and template name. -- API to update a template by template name and project name. -- API to delete a template by template name and project name. -- API to export the projects for given projectNames. -- API to export the templates for given templateIds. -- API to manage operation create of the resource Configuration Template Import Project. -- API to manage operation create of the resource Configuration Template Import Template. + - Manage operations create, update and delete of the resource Configuration Template. + - API to create a template by project name and template name. + - API to update a template by template name and project name. + - API to delete a template by template name and project name. + - API to export the projects for given projectNames. + - API to export the templates for given templateIds. + - API to manage operation create of the resource Configuration Template Import Project. + - API to manage operation create of the resource Configuration Template Import Template. version_added: '6.6.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -38,11 +38,11 @@ state: description: The state of Cisco Catalyst Center after module completion. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: - - List of details of templates being managed. + - List of details of templates being managed. type: list elements: dict required: true @@ -59,9 +59,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -252,8 +252,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -424,22 +424,22 @@ suboptions: do_version: description: - - Determines whether to create a new version of the project with the imported contents. - - If set to true and the project already exists, a new version will be created. - - If false, the operation will fail with a 'Project already exists' error if the project already exists. + - Determines whether to create a new version of the project with the imported contents. + - If set to true and the project already exists, a new version will be created. + - If false, the operation will fail with a 'Project already exists' error if the project already exists. type: bool project_file: description: - - Specifies the path to a JSON file that contains the import project configuration. - - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. + - Specifies the path to a JSON file that contains the import project configuration. + - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. type: str version_added: 6.17.0 payload: description: - - Directly imports configuration data into the system using the provided payload. - - Offers an alternative to 'project_file' for importing configurations without referencing an external file. - - Ignored if 'project_file' is also provided. - type: list + - Directly imports configuration data into the system using the provided payload. + - Offers an alternative to 'project_file' for importing configurations without referencing an external file. + - Ignored if 'project_file' is also provided. + type: list elements: dict suboptions: name: @@ -457,14 +457,14 @@ type: bool template_file: description: - - Specifies the path to a JSON file that contains an import template. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - Specifies the path to a JSON file that contains an import template. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: str payload: description: - - The payload parameter is used to directly import configuration data into the system. - - The payload provides an alternative way to import configurations without the need to reference an external file. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - The payload parameter is used to directly import configuration data into the system. + - The payload provides an alternative way to import configurations without the need to reference an external file. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: list elements: dict suboptions: @@ -476,9 +476,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -666,8 +666,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -885,8 +885,8 @@ requirements: -- dnacentersdk >= 2.7.2 -- python >= 3.9 + - dnacentersdk >= 2.7.2 + - python >= 3.9 notes: - SDK Method used are configuration_templates.ConfigurationTemplates.create_template, From a93967c97a2e5d29022243d5400e869cb9887e38 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 14:51:49 +0530 Subject: [PATCH 15/20] revert the space after - --- plugins/modules/template_workflow_manager.py | 70 ++++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index 32ab9c9ae..f21b38900 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -14,14 +14,14 @@ module: template_workflow_manager short_description: Resource module for Template functions description: - - Manage operations create, update and delete of the resource Configuration Template. - - API to create a template by project name and template name. - - API to update a template by template name and project name. - - API to delete a template by template name and project name. - - API to export the projects for given projectNames. - - API to export the templates for given templateIds. - - API to manage operation create of the resource Configuration Template Import Project. - - API to manage operation create of the resource Configuration Template Import Template. +- Manage operations create, update and delete of the resource Configuration Template. +- API to create a template by project name and template name. +- API to update a template by template name and project name. +- API to delete a template by template name and project name. +- API to export the projects for given projectNames. +- API to export the templates for given templateIds. +- API to manage operation create of the resource Configuration Template Import Project. +- API to manage operation create of the resource Configuration Template Import Template. version_added: '6.6.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -42,7 +42,7 @@ default: merged config: description: - - List of details of templates being managed. + - List of details of templates being managed. type: list elements: dict required: true @@ -59,9 +59,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -252,8 +252,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -424,22 +424,22 @@ suboptions: do_version: description: - - Determines whether to create a new version of the project with the imported contents. - - If set to true and the project already exists, a new version will be created. - - If false, the operation will fail with a 'Project already exists' error if the project already exists. + - Determines whether to create a new version of the project with the imported contents. + - If set to true and the project already exists, a new version will be created. + - If false, the operation will fail with a 'Project already exists' error if the project already exists. type: bool project_file: description: - - Specifies the path to a JSON file that contains the import project configuration. - - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. + - Specifies the path to a JSON file that contains the import project configuration. + - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. type: str version_added: 6.17.0 payload: description: - - Directly imports configuration data into the system using the provided payload. - - Offers an alternative to 'project_file' for importing configurations without referencing an external file. - - Ignored if 'project_file' is also provided. - type: list + - Directly imports configuration data into the system using the provided payload. + - Offers an alternative to 'project_file' for importing configurations without referencing an external file. + - Ignored if 'project_file' is also provided. + type: list elements: dict suboptions: name: @@ -457,14 +457,14 @@ type: bool template_file: description: - - Specifies the path to a JSON file that contains an import template. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - Specifies the path to a JSON file that contains an import template. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: str payload: description: - - The payload parameter is used to directly import configuration data into the system. - - The payload provides an alternative way to import configurations without the need to reference an external file. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - The payload parameter is used to directly import configuration data into the system. + - The payload provides an alternative way to import configurations without the need to reference an external file. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: list elements: dict suboptions: @@ -476,9 +476,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -666,8 +666,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -885,8 +885,8 @@ requirements: - - dnacentersdk >= 2.7.2 - - python >= 3.9 +- dnacentersdk >= 2.7.2 +- python >= 3.9 notes: - SDK Method used are configuration_templates.ConfigurationTemplates.create_template, From 933beff5646f577e38773b7c36950ab5b8b9189e Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 14:58:41 +0530 Subject: [PATCH 16/20] fix sanity errors --- plugins/modules/template_workflow_manager.py | 70 ++++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/plugins/modules/template_workflow_manager.py b/plugins/modules/template_workflow_manager.py index f21b38900..b5fc0b1ed 100644 --- a/plugins/modules/template_workflow_manager.py +++ b/plugins/modules/template_workflow_manager.py @@ -14,14 +14,14 @@ module: template_workflow_manager short_description: Resource module for Template functions description: -- Manage operations create, update and delete of the resource Configuration Template. -- API to create a template by project name and template name. -- API to update a template by template name and project name. -- API to delete a template by template name and project name. -- API to export the projects for given projectNames. -- API to export the templates for given templateIds. -- API to manage operation create of the resource Configuration Template Import Project. -- API to manage operation create of the resource Configuration Template Import Template. + - Manage operations create, update and delete of the resource Configuration Template. + - API to create a template by project name and template name. + - API to update a template by template name and project name. + - API to delete a template by template name and project name. + - API to export the projects for given projectNames. + - API to export the templates for given templateIds. + - API to manage operation create of the resource Configuration Template Import Project. + - API to manage operation create of the resource Configuration Template Import Template. version_added: '6.6.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params @@ -34,7 +34,7 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center after applying the playbook config. type: bool - default: False + default: false state: description: The state of Cisco Catalyst Center after module completion. type: str @@ -42,7 +42,7 @@ default: merged config: description: - - List of details of templates being managed. + - List of details of templates being managed. type: list elements: dict required: true @@ -59,9 +59,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -252,8 +252,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -424,21 +424,21 @@ suboptions: do_version: description: - - Determines whether to create a new version of the project with the imported contents. - - If set to true and the project already exists, a new version will be created. - - If false, the operation will fail with a 'Project already exists' error if the project already exists. + - Determines whether to create a new version of the project with the imported contents. + - If set to true and the project already exists, a new version will be created. + - If false, the operation will fail with a 'Project already exists' error if the project already exists. type: bool project_file: description: - - Specifies the path to a JSON file that contains the import project configuration. - - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. + - Specifies the path to a JSON file that contains the import project configuration. + - If both 'project_file' and 'payload' are provided, the 'project_file' will be given priority. type: str version_added: 6.17.0 payload: description: - - Directly imports configuration data into the system using the provided payload. - - Offers an alternative to 'project_file' for importing configurations without referencing an external file. - - Ignored if 'project_file' is also provided. + - Directly imports configuration data into the system using the provided payload. + - Offers an alternative to 'project_file' for importing configurations without referencing an external file. + - Ignored if 'project_file' is also provided. type: list elements: dict suboptions: @@ -457,14 +457,14 @@ type: bool template_file: description: - - Specifies the path to a JSON file that contains an import template. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - Specifies the path to a JSON file that contains an import template. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: str payload: description: - - The payload parameter is used to directly import configuration data into the system. - - The payload provides an alternative way to import configurations without the need to reference an external file. - - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. + - The payload parameter is used to directly import configuration data into the system. + - The payload provides an alternative way to import configurations without the need to reference an external file. + - If both 'template_file' and 'payload' are provided, the 'template_file' will be given priority. type: list elements: dict suboptions: @@ -476,9 +476,9 @@ type: bool containing_templates: description: - - Refer to a set of templates within the main template to define more complex or modular configurations. - - This is particularly useful in systems that support hierarchical or nested templates. - - Here parent templates may contain child templates to form a complete configuration. + - Refer to a set of templates within the main template to define more complex or modular configurations. + - This is particularly useful in systems that support hierarchical or nested templates. + - Here parent templates may contain child templates to form a complete configuration. suboptions: composite: description: Specifies if the template is composite. @@ -666,8 +666,8 @@ type: str failure_policy: description: - - Define failure policy if template provisioning fails. - - failure_policy will be enabled only when the composite is set to True. + - Define failure policy if template provisioning fails. + - failure_policy will be enabled only when the composite is set to True. choices: - ABORT_TARGET_ON_ERROR type: str @@ -885,8 +885,8 @@ requirements: -- dnacentersdk >= 2.7.2 -- python >= 3.9 + - dnacentersdk >= 2.7.2 + - python >= 3.9 notes: - SDK Method used are configuration_templates.ConfigurationTemplates.create_template, From c207857391fcdbf41c411984b8f764e633bc3fab Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 15:05:28 +0530 Subject: [PATCH 17/20] fix sanity for fabric site module --- .../sda_fabric_sites_zones_workflow_manager.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py index bf7c9719f..54cecd21d 100644 --- a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py +++ b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py @@ -30,11 +30,11 @@ config_verify: description: Set to True to verify the Cisco Catalyst Center configuration after applying the playbook configuration. type: bool - default: False + default: false state: description: The desired state of Cisco Catalyst Center after the module execution. type: str - choices: [ merged, deleted ] + choices: [merged, deleted] default: merged config: description: A list containing detailed configurations for creating, updating, or deleting fabric sites or zones @@ -44,7 +44,7 @@ to authentication profiles. type: list elements: dict - required: True + required: true suboptions: fabric_sites: description: A dictionary containing detailed configurations for managing REST Endpoints that will receive Audit log @@ -57,13 +57,13 @@ sites or zones, as well as for updating the authentication profile template. This parameter is mandatory for any fabric site/zone management operation. type: str - required: True + required: true fabric_type: description: Specifies the type of site to be managed within the SDA environment. The acceptable values are 'fabric_site' and 'fabric_zone'. The default value is 'fabric_site', indicating the configuration of a broader network area, whereas 'fabric_zone' typically refers to a more specific segment within the site. type: str - required: True + required: true authentication_profile: description: The authentication profile applied to the specified fabric. This profile determines the security posture and controls for network access within the site. Possible values include 'Closed Authentication', 'Low Impact', @@ -107,8 +107,8 @@ requirements: -- dnacentersdk >= 2.9.2 -- python >= 3.9 + - dnacentersdk >= 2.9.2 + - python >= 3.9 notes: - To ensure the module operates correctly for scaled sets, which involve creating or updating fabric sites/zones and handling From ffa779984aabd5465bd1722fae015b3df675a7f7 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 15:10:56 +0530 Subject: [PATCH 18/20] fix sanity --- .../sda_fabric_sites_zones_workflow_manager.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py index 54cecd21d..7862cb481 100644 --- a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py +++ b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py @@ -14,13 +14,13 @@ module: sda_fabric_sites_zones_workflow_manager short_description: Manage fabric site(s)/zone(s) and update the authentication profile template in Cisco Catalyst Center. description: -- Creating fabric site(s) for the SDA operation in Cisco Catalyst Center. -- Updating fabric site(s) for the SDA operation in Cisco Catalyst Center. -- Creating fabric zone(s) for the SDA operation in Cisco Catalyst Center. -- Updating fabric zone(s) for the SDA operation in Cisco Catalyst Center. -- Deletes fabric site(s) from Cisco Catalyst Center. -- Deletes fabric zone(s) from Cisco Catalyst Center. -- Configure the authentication profile template for fabric site/zone in Cisco Catalyst Center. + - Creating fabric site(s) for the SDA operation in Cisco Catalyst Center. + - Updating fabric site(s) for the SDA operation in Cisco Catalyst Center. + - Creating fabric zone(s) for the SDA operation in Cisco Catalyst Center. + - Updating fabric zone(s) for the SDA operation in Cisco Catalyst Center. + - Deletes fabric site(s) from Cisco Catalyst Center. + - Deletes fabric zone(s) from Cisco Catalyst Center. + - Configure the authentication profile template for fabric site/zone in Cisco Catalyst Center. version_added: '6.17.0' extends_documentation_fragment: - cisco.dnac.workflow_manager_params From 885d7720cd1bd4669a7d6252ce55388b6521d5af Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 15:20:07 +0530 Subject: [PATCH 19/20] revert readme changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b1c7a896..aafbc2f9a 100644 --- a/README.md +++ b/README.md @@ -210,4 +210,4 @@ Please read and familiarize yourself with this document. This collection follows [Semantic Versioning](https://semver.org/). More details on versioning can be found [in the Ansible docs](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-versions). -New minor and major releases as well as deprecations will follow new releases and deprecations of the Cisco DNA Center product, its REST API and the corresponding Python SDK, which this project relies on. +New minor and major releases as well as deprecations will follow new releases and deprecations of the Cisco DNA Center product, its REST API and the corresponding Python SDK, which this project relies on. From af546a3992c08bedbd763b6a237ce097f6f317d7 Mon Sep 17 00:00:00 2001 From: Abhishek-121 Date: Thu, 28 Nov 2024 16:34:18 +0530 Subject: [PATCH 20/20] Update the log messages --- .../sda_fabric_sites_zones_workflow_manager.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py index 7862cb481..0d9630006 100644 --- a/plugins/modules/sda_fabric_sites_zones_workflow_manager.py +++ b/plugins/modules/sda_fabric_sites_zones_workflow_manager.py @@ -1340,14 +1340,17 @@ def get_diff_merged(self, config): # Create/Update Fabric sites/zones in Cisco Catalyst Center raw_fabric_sites = self.want.get('fabric_sites') # Preserve the order of input while deduplicating + self.log("Starting deduplication of raw_fabric_sites.", "DEBUG") unique_fabric_site_set = set() fabric_sites = [] for fabric_site_dict in raw_fabric_sites: # Convert dictionary to a frozenset - immutable set site_zone = frozenset(fabric_site_dict.items()) if site_zone not in unique_fabric_site_set: + self.log("New unique site found: '{0}'".format(site_zone), "DEBUG") unique_fabric_site_set.add(site_zone) fabric_sites.append(fabric_site_dict) + self.log("Deduplication complete. Total unique sites: {0}".format(len(fabric_sites)), "DEBUG") for site in fabric_sites: site_name = site.get("site_name_hierarchy") @@ -1502,7 +1505,20 @@ def get_diff_deleted(self, config): self.set_operation_result("failed", False, self.msg, "ERROR") return self - fabric_sites = self.want.get('fabric_sites') + raw_fabric_sites = self.want.get('fabric_sites') + # Preserve the order of input while deduplicating + self.log("Starting deduplication of raw_fabric_sites.", "DEBUG") + unique_fabric_site_set = set() + fabric_sites = [] + for fabric_site_dict in raw_fabric_sites: + # Convert dictionary to a frozenset - immutable set + site_zone = frozenset(fabric_site_dict.items()) + if site_zone not in unique_fabric_site_set: + self.log("New unique site found: '{0}'".format(site_zone), "DEBUG") + unique_fabric_site_set.add(site_zone) + fabric_sites.append(fabric_site_dict) + + self.log("Deduplication complete. Total unique sites: {0}".format(len(fabric_sites)), "DEBUG") fabric_site_dict = {} for site in fabric_sites: