Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examppple added for un-tag and tag a image #78

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions plugins/modules/swim_workflow_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,12 @@

- Added the parameter 'dnac_api_task_timeout', 'dnac_task_poll_interval' options in v6.13.2.

- additional_info |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can include this information in device_role itself

device_role:
  description: |
    Specifies the device role(s) for tagging or untagging the image as golden.

    Permissible values:
    - 'ALL': Applies the golden tag to all devices, regardless of role.
    - 'UNKNOWN': Tags devices without a specified classification.
    - 'ACCESS': Tags devices that connect end-user devices (e.g., access switches).
    - 'BORDER ROUTER': Tags devices linking different network segments or domains.
    - 'DISTRIBUTION': Tags devices aggregating traffic toward the core.
    - 'CORE': Tags backbone devices handling high-volume network traffic.

    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.
  type: str

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"""
Expand Down Expand Up @@ -462,6 +468,30 @@
site_name: Global/USA/San Francisco/BGL_18
tagging: True

# 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}}"
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}}"
Expand Down
Loading