From 74b9ebaddcead2a662156cd1fbdd298fc5937455 Mon Sep 17 00:00:00 2001 From: Syed-khadeerahmed Date: Fri, 20 Dec 2024 09:28:16 +0530 Subject: [PATCH 1/4] examppple added for un-tag and tag a image --- plugins/modules/swim_workflow_manager.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/plugins/modules/swim_workflow_manager.py b/plugins/modules/swim_workflow_manager.py index df7ddc0673..1ed9cfc43d 100644 --- a/plugins/modules/swim_workflow_manager.py +++ b/plugins/modules/swim_workflow_manager.py @@ -462,6 +462,29 @@ site_name: Global/USA/San Francisco/BGL_18 tagging: True +- name: Remove the golden tag from the specified image for the given device role and assign it to another device role. + cisco.dnac.swim_workflow_manager: + dnac_host: "{{dnac_host}}" + dnac_username: "{{dnac_username}}" + dnac_password: "{{dnac_password}}" + dnac_verify: "{{dnac_verify}}" + dnac_port: "{{dnac_port}}" + dnac_version: "{{dnac_version}}" + dnac_debug: "{{dnac_debug}}" + dnac_log_level: "{{dnac_log_level}}" + dnac_log: True + config: + - tagging_details: + image_name: cat9k_iosxe.17.12.01.SPA.bin + device_role: Core + device_image_family_name: Cisco Catalyst 9300 Switch + tagging: False + - tagging_details: + image_name: cat9k_iosxe.17.12.01.SPA.bin + device_role: ACCESS + device_image_family_name: Cisco Catalyst 9300 Switch + tagging: True + - name: Tag the specified image as golden for multiple device roles and load it into the device cisco.dnac.swim_workflow_manager: dnac_host: "{{dnac_host}}" From 35572a9f03d815d9e76b8c13a1d32e13f1bdca7f Mon Sep 17 00:00:00 2001 From: Syed-khadeerahmed Date: Fri, 20 Dec 2024 11:32:54 +0530 Subject: [PATCH 2/4] review comments compleated --- plugins/modules/swim_workflow_manager.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins/modules/swim_workflow_manager.py b/plugins/modules/swim_workflow_manager.py index 1ed9cfc43d..c9f4b3fda5 100644 --- a/plugins/modules/swim_workflow_manager.py +++ b/plugins/modules/swim_workflow_manager.py @@ -343,6 +343,12 @@ - Added the parameter 'dnac_api_task_timeout', 'dnac_task_poll_interval' options in v6.13.2. + - additional_info | + To achieve the final golden tag status, first unassign the tag from the specified device role. + Once the tag has been removed, assign it to the target device role. + This step ensures the image is correctly tagged for the new role, aligning the configuration as intended. + + """ EXAMPLES = r""" @@ -462,7 +468,8 @@ site_name: Global/USA/San Francisco/BGL_18 tagging: True -- name: Remove the golden tag from the specified image for the given device role and assign it to another device role. +# Remove the golden tag from the specified image for the given device role and assign it to another device role. +- name: Update golden tag assignment for image based on device role cisco.dnac.swim_workflow_manager: dnac_host: "{{dnac_host}}" dnac_username: "{{dnac_username}}" @@ -472,18 +479,18 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" dnac_log_level: "{{dnac_log_level}}" - dnac_log: True + dnac_log: true config: - tagging_details: image_name: cat9k_iosxe.17.12.01.SPA.bin - device_role: Core + device_role: CORE device_image_family_name: Cisco Catalyst 9300 Switch - tagging: False + tagging: false - tagging_details: image_name: cat9k_iosxe.17.12.01.SPA.bin device_role: ACCESS device_image_family_name: Cisco Catalyst 9300 Switch - tagging: True + tagging: true - name: Tag the specified image as golden for multiple device roles and load it into the device cisco.dnac.swim_workflow_manager: From 0aa0c49f1b0e886eef3087b8239427ccfe38117d Mon Sep 17 00:00:00 2001 From: Syed-khadeerahmed Date: Fri, 20 Dec 2024 12:29:17 +0530 Subject: [PATCH 3/4] review comments fixed --- plugins/modules/swim_workflow_manager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/modules/swim_workflow_manager.py b/plugins/modules/swim_workflow_manager.py index c9f4b3fda5..96e1a33dde 100644 --- a/plugins/modules/swim_workflow_manager.py +++ b/plugins/modules/swim_workflow_manager.py @@ -189,6 +189,9 @@ Behavior: - If 'device_role' is a single string (e.g., `"ACCESS"`), only that role is tagged as golden. - If 'device_role' contains multiple roles (e.g., `"ACCESS,CORE"`), all specified roles are tagged as golden. + To replace an existing golden tag for a specific role: + - **Unassign** the tag from the current role (e.g., `ACCESS`). + - **Assign** the tag to the new role (e.g., `CORE`). Examples: - device_role: "ACCESS" tags only the `ACCESS` role as golden. - device_role: "ACCESS,CORE" tags both `ACCESS` and `CORE` roles as golden. From af66bfbdd750c7200f327151d5a0e41a2b110d48 Mon Sep 17 00:00:00 2001 From: Syed-khadeerahmed Date: Fri, 20 Dec 2024 12:30:16 +0530 Subject: [PATCH 4/4] review comments fixed --- plugins/modules/swim_workflow_manager.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/modules/swim_workflow_manager.py b/plugins/modules/swim_workflow_manager.py index 96e1a33dde..3c341426c5 100644 --- a/plugins/modules/swim_workflow_manager.py +++ b/plugins/modules/swim_workflow_manager.py @@ -346,10 +346,6 @@ - Added the parameter 'dnac_api_task_timeout', 'dnac_task_poll_interval' options in v6.13.2. - - additional_info | - To achieve the final golden tag status, first unassign the tag from the specified device role. - Once the tag has been removed, assign it to the target device role. - This step ensures the image is correctly tagged for the new role, aligning the configuration as intended. """