cisco.dnac.lan_automation_workflow_manager module – Automate network discovery, deployment, and device configuration with LAN Automation in Cisco Catalyst Center.

Note

This module is part of the cisco.dnac collection (version 6.42.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install cisco.dnac. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.dnac.lan_automation_workflow_manager.

New in cisco.dnac 6.20.0

Synopsis

  • Configuring LAN Automation sessions in Cisco Catalyst Center for automated discovery of devices and their integration into the network.

  • Updating LAN Automation device configurations, including loopback addresses, hostnames, and link configurations.

  • Automatically stopping an ongoing LAN Automation session based on conditions like timeout or discovery device list completion, without explicitly calling the stop API.

  • Additionally, it provides functionalities to stop ongoing LAN Automation sessions and to handle PnP device authorization.

Requirements

The below requirements are needed on the host that executes this module.

  • dnacentersdk >= 2.9.2

  • python >= 3.9

Parameters

Parameter

Comments

config

list / elements=dictionary / required

A list containing detailed configurations for creating and stopping a LAN Automation session, and also for updating loopback addresses, hostnames, and link configurations for LAN automated devices. Each element in the list represents a specific operation to be performed on the LAN automation infrastructure.

lan_automated_device_update

dictionary

Configuration for updating device settings discovered through LAN Automation.

hostname_update_devices

list / elements=dictionary

List of devices to update with new hostnames.

device_management_ip_address

string / required

Management IP address of the device.

new_host_name

string / required

New hostname for the device.

dictionary

Add a new link between two devices.

string / required

Interface name on the destination device.

string / required

Management IP address of the destination device.

string / required

Name of the IP pool configured within LAN Automation, from which IP addresses will be allocated for the new link.

string / required

Interface name on the source device.

string / required

Management IP address of the source device.

dictionary

Remove an existing link between two devices.

string / required

Interface name on the destination device.

string / required

Management IP address of the destination device.

string / required

Interface name on the source device.

string / required

Management IP address of the source device.

loopback_update_device_list

list / elements=dictionary

List of devices to update with new loopback IP addresses.

device_management_ip_address

string / required

Management IP address of the device.

new_loopback0_ip_address

string / required

New Loopback0 IP Address for the device, sourced from the LAN pool associated with the device discovery site.

lan_automation

dictionary

Configuration for starting or stopping LAN Automation sessions.

device_serial_number_authorization

list / elements=string

A list of serial numbers of devices to be authorized during the session.

discovered_device_site_name_hierarchy

string / required

Site hierarchy where the discovered devices will be placed.

discovery_devices

list / elements=dictionary

A list of devices to be discovered during the LAN Automation session. If only a device list is provided without a timeout, stop processing will occur once all devices from the list are discovered. The maximum number of devices that can be provided for a session is 50. If both the discovery devices list and timeout are provided, the stop processing will be attempted whichever happens earlier. Users may choose to use the LAN Automation ‘deleted’ state to stop processing at any time.

device_host_name

string

Hostname of the device to be discovered.

device_management_ip_address

string

Management IP address of the device.

device_serial_number

string / required

Serial number of the device to be discovered.

device_site_name_hierarchy

string

Site hierarchy where the device will be placed after discovery.

discovery_level

integer

Depth of the discovery during LAN automation (e.g., Level 1-5 below the primary seed device).

Default: 2

discovery_timeout

integer

Timeout for device discovery during LAN Automation, in minutes. Until this time, stop processing will not be triggered. Any device contacting after the provided discovery timeout will not be processed, and a device reset and reload will be attempted to bring it back to the PnP agent state before process completion. The supported timeout range is in minutes [20-10080]. If both ‘discovery_timeout’ and ‘discovery_devices’ are provided, processing will stop based on whichever occurs earlier. Users can always use the LAN Automation deleted state to force stop processing.

host_name_prefix

string

Prefix used for auto-generating hostnames during the LAN Automation session.

ip_pools

list / elements=dictionary / required

A list of IP pools used during the LAN Automation session.

ip_pool_name

string / required

Name of the IP pool.

ip_pool_role

string / required

Role of the IP pool in the automation session, either MAIN_POOL or PHYSICAL_LINK_POOL.

Choices:

  • "MAIN_POOL"

  • "PHYSICAL_LINK_POOL"

isis_domain_pwd

string

Password for IS-IS domain configuration.

launch_and_wait

boolean

Flag indicating whether the task should pause until the LAN Automation session completes before continuing to subsequent tasks. If set to false, the process will move to the next task immediately.

Choices:

  • false ← (default)

  • true

multicast_enabled

boolean

Flag to enable multicast routing in the LAN Automation session.

Choices:

  • false ← (default)

  • true

peer_device_management_ip_address

string

Management IP address of the peer device in the LAN Automation session.

pnp_authorization

boolean

Flag to enable Plug and Play (PnP) authorization for devices discovered during the session.

Choices:

  • false ← (default)

  • true

primary_device_interface_names

list / elements=string / required

A list of interface names on the primary device to be used for LAN automation.

primary_device_management_ip_address

string / required

Management IP address of the primary or seed device in the LAN Automation session.

redistribute_isis_to_bgp

boolean

Flag to enable the redistribution of IS-IS routes to BGP.

Choices:

  • false ← (default)

  • true

port_channel

list / elements=dictionary

Configuration to create, update, or delete Port Channels between two LAN Automated devices in Cisco Catalyst Center. Port Channels aggregate multiple physical links between devices to provide increased bandwidth and redundancy.

destination_device_mac_address

string

MAC address of the destination device. Alternative to management IP address or serial number for device identification. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

destination_device_management_ip_address

string

Management IP address of the destination device. At least one device identifier (IP address, MAC address, or serial number) must be provided for the destination device. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

destination_device_serial_number

string

Serial number of the destination device. Alternative to management IP address or MAC address for device identification. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

list / elements=dictionary

- List of physical interface links to include in the Port Channel. - Required for create operations - at least one link must be specified. - Optional for update operations - adds/removes links from existing Port Channel. - All links must be between the same source and destination devices. - Interface names must match exact device interface nomenclature.

string / required

Interface name on the destination device (e.g., ‘GigabitEthernet1/0/1’, ‘TenGigabitEthernet1/0/1’). Must be a valid, available interface on the destination device that is not already part of another Port Channel.

string / required

Interface name on the source device (e.g., ‘GigabitEthernet1/0/1’, ‘TenGigabitEthernet1/0/1’). Must be a valid, available interface on the source device that is not already part of another Port Channel.

port_channel_number

integer

- This value is system-assigned during creation and user provided value will be ignored. Catalyst Center will automatically provide a unique number upon creation. - Can be used for update operations to target a specific existing Port Channel for modification (adding/removing interfaces). - Can be used for delete operations to identify the specific Port Channel to remove from the device pair. - When used for update/delete operations, eliminates the need to specify existing interface links for Port Channel identification.

source_device_mac_address

string

MAC address of the source device. Alternative to management IP address or serial number for device identification. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

source_device_management_ip_address

string

Management IP address of the source device. At least one device identifier (IP address, MAC address, or serial number) must be provided for the source device. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

source_device_serial_number

string

Serial number of the source device. Alternative to management IP address or MAC address for device identification. The device must be LAN Automated and in Reachable and Managed state in Cisco Catalyst Center inventory.

config_verify

boolean

Set to true to verify the LAN Automation config after applying the playbook config.

Choices:

  • false ← (default)

  • true

dnac_api_task_timeout

integer

The maximum time to wait for a task to complete on Cisco DNA Center for LAN Automation.

Default: 604800

dnac_debug

boolean

Indicates whether debugging is enabled in the Cisco Catalyst Center SDK.

Choices:

  • false ← (default)

  • true

dnac_host

string / required

The hostname of the Cisco Catalyst Center.

dnac_log

boolean

Flag to enable/disable playbook execution logging.

When true and dnac_log_file_path is provided, - Create the log file at the execution location with the specified name.

When true and dnac_log_file_path is not provided, - Create the log file at the execution location with the name ‘dnac.log’.

When false, - Logging is disabled.

If the log file doesn’t exist, - It is created in append or write mode based on the “dnac_log_append” flag.

If the log file exists, - It is overwritten or appended based on the “dnac_log_append” flag.

Choices:

  • false ← (default)

  • true

dnac_log_append

boolean

Determines the mode of the file. Set to True for ‘append’ mode. Set to False for ‘write’ mode.

Choices:

  • false

  • true ← (default)

dnac_log_file_path

string

Governs logging. Logs are recorded if dnac_log is True.

If path is not specified, - When ‘dnac_log_append’ is True, ‘dnac.log’ is generated in the current Ansible directory; logs are appended. - When ‘dnac_log_append’ is False, ‘dnac.log’ is generated; logs are overwritten.

If path is specified, - When ‘dnac_log_append’ is True, the file opens in append mode. - When ‘dnac_log_append’ is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True.

Default: "dnac.log"

dnac_log_level

string

Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG].

CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages.

ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages.

WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages.

INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages.

DEBUG provides detailed diagnostic info. Displays all log messages.

Default: "WARNING"

dnac_password

string

The password for authentication at the Cisco Catalyst Center.

dnac_port

string

Specifies the port number associated with the Cisco Catalyst Center.

Default: "443"

dnac_task_poll_interval

integer

The interval, in seconds, to poll for task completion.

Default: 30

dnac_username

aliases: user

string

The username for authentication at the Cisco Catalyst Center.

Default: "admin"

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

  • false

  • true ← (default)

dnac_version

string

Specifies the version of the Cisco Catalyst Center that the SDK should use.

Default: "2.2.3.3"

state

string

The state of Cisco Catalyst Center after module completion.

Choices:

  • "merged" ← (default)

  • "deleted"

validate_response_schema

boolean

Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

  • false

  • true ← (default)

Notes

Note

  • When waiting for the LAN automation session to complete, the timeout and the list of devices to be discovered will initially be considered. If neither a timeout nor a device list is provided, LAN automation will continue running until stopped.

  • To stop a LAN automation session, execute the same details in the ‘deleted’ state. Only the seed device IP is required to terminate the session.

  • PnP authorization will be performed if device authorization has been selected in Catalyst Center. LAN automation will continue running until the provided serial numbers are authorized, continuously checking the status of the devices. If PnP authorization is enabled without a list of devices for either authorization or discovery, the module will not wait for the LAN automation task to complete. However, if a device is in an Error state or authorization is not checked on Catalyst Center, the playbook will keep running until the state of the device is active or reached the timeout value.

  • Port Channel operations require both source and destination devices to be LAN Automated devices in Reachable and Managed state within Cisco Catalyst Center inventory.

  • For the source device, at least one of identifier must be provided from management IP address, MAC address, or serial number.

  • For the destination device, at least one of identifier must be provided from management IP address, MAC address, or serial number when performing create or update operations, and is recommended when targeting a specific Port Channel for deletion.

  • When multiple device identifiers are provided for the same device, precedence order is serial_number > management_ip_address > mac_address.

  • Port Channel link constraints - each Port Channel must maintain between 2 and 8 physical links. Operations creating Port Channels with fewer than 2 or more than 8 links will fail validation.

  • Port Channel identification for updates can use either existing link specifications or port_channel_number parameter. When both are provided, port_channel_number takes precedence for identification.

  • Link isolation requirement - physical links cannot be shared between multiple Port Channels. Each link belongs exclusively to one Port Channel configuration.

  • Source and destination terminology is used for configuration consistency only. Both devices function as equal peers in the resulting Port Channel aggregation.

  • Port Channel deletion behavior varies based on provided parameters. When deleting Port Channels without specifying individual links, if port_channel_number is provided, only that specific Port Channel will be deleted. If both endpoints are provided without port_channel_number, all Port Channels between those devices will be deleted. If only source endpoint is provided, all Port Channels from that source device will be deleted.

  • Port Channel deletion behavior when deleting individual links - removing links that would result in fewer than 2 remaining links will automatically delete the entire Port Channel. Operations that would leave exactly 1 link will fail validation as Port Channels require minimum 2 links for proper operation.

  • Port Channel operations integrate with existing LAN Automation device lifecycle management and appear in standard Catalyst Center interface topology views.

  • When updating Port Channels, at least one existing link must be provided to identify the Port Channel between the same endpoints unless port_channel_number is specified for direct identification.

  • Links from different Port Channels cannot be mixed during update operations. Each physical link can belong to only one Port Channel at any given time.

  • SDK Method used are lan_automation.LanAutomation.lan_automation_start_v2 lan_automation.LanAutomation.lan_automation_stop lan_automation.LanAutomation.lan_automation_device_update lan_automation.LanAutomation.lan_automation_active_sessions lan_automation.LanAutomation.lan_automation_status lan_automation.LanAutomation.lan_automation_log lan_automation.LanAutomation.get_port_channels lan_automation.LanAutomation.create_a_new_port_channel_between_devices lan_automation.LanAutomation.add_a_lan_automated_link_to_a_port_channel lan_automation.LanAutomation.delete_port_channel lan_automation.LanAutomation.remove_a_link_from_port_channel devices.Devices.get_interface_details devices.Devices.get_device_list device_onboarding_pnp.DeviceOnboardingPnp.authorize_device device_onboarding_pnp.DeviceOnboardingPnp.get_device_list

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins instead embedded connection manager from Cisco Catalyst Center SDK

  • The parameters starting with dnac_ are used by the Cisco Catalyst Center Python SDK to establish the connection

Examples

---
- name: Start a LAN Automation session without waiting
    for it to finish
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automation:
          discovered_device_site_name_hierarchy: "Global/USA/SAN
            JOSE"
          peer_device_management_ip_address: "204.1.1.2"
          primary_device_management_ip_address: "204.1.1.1"
          primary_device_interface_names:
            - "HundredGigE1/0/2"
            - "HundredGigE1/0/29"
          ip_pools:
            - ip_pool_name: "underlay_sub"
              ip_pool_role: "MAIN_POOL"
            - ip_pool_name: "underlay_sub_sj"
              ip_pool_role: "PHYSICAL_LINK_POOL"
          multicast_enabled: true
          redistribute_isis_to_bgp: true
          host_name_prefix: "San-Jose"
          isis_domain_pwd: "cisco"
          discovery_level: 5
          discovery_timeout: 40
          discovery_devices:
            - device_serial_number: "FJC27172JDW"
              device_host_name: "SR-LAN-9300-IM1"
              device_site_name_hierarchy: "Global/USA/SAN
                JOSE/BLD23"
              device_management_ip_address: "204.1.1.10"
            - device_serial_number: "FJC2721261A"
              device_host_name: "SR-LAN-9300-IM2"
              device_site_name_hierarchy: "Global/USA/SAN
                JOSE/BLD20"
              device_management_ip_address: "204.1.1.11"
          launch_and_wait: false
          pnp_authorization: false

- name: Start a LAN Automation session with device authorization
    and waiting for the task to complete
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automation:
          discovered_device_site_name_hierarchy: "Global/USA/SAN
            JOSE"
          peer_device_management_ip_address: "204.1.1.2"
          primary_device_management_ip_address: "204.1.1.1"
          primary_device_interface_names:
            - "HundredGigE1/0/2"
            - "HundredGigE1/0/29"
          ip_pools:
            - ip_pool_name: "underlay_sub"
              ip_pool_role: "MAIN_POOL"
            - ip_pool_name: "underlay_sub_sj"
              ip_pool_role: "PHYSICAL_LINK_POOL"
          multicast_enabled: true
          redistribute_isis_to_bgp: true
          host_name_prefix: "San-Jose"
          isis_domain_pwd: "cisco"
          discovery_level: 5
          discovery_timeout: 40
          discovery_devices:
            - device_serial_number: "FJC27172JDW"
              device_host_name: "SR-LAN-9300-IM1"
              device_site_name_hierarchy: "Global/USA/SAN
                JOSE/BLD23"
              device_management_ip_address: "204.1.1.10"
            - device_serial_number: "FJC2721261A"
              device_host_name: "SR-LAN-9300-IM2"
              device_site_name_hierarchy: "Global/USA/SAN
                JOSE/BLD20"
              device_management_ip_address: "204.1.1.11"
          launch_and_wait: true
          pnp_authorization: true
          device_serial_number_authorization:
            - "FJC27172JDW"
            - "FJC2721261A"

- name: Stop a LAN Automation session
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - lan_automation:
          discovered_device_site_name_hierarchy: "Global/USA/SAN
            JOSE"
          primary_device_management_ip_address: "204.1.1.1"

- name: Update loopback for LAN Automated devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automated_device_update:
          loopback_update_device_list:
            - device_management_ip_address: "204.1.3.160"
              new_loopback0_ip_address: "91.1.2.6"
            - device_management_ip_address: "204.1.2.163"
              new_loopback0_ip_address: "91.1.2.5"

- name: Update hostname for LAN Automated devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automated_device_update:
          hostname_update_devices:
            - device_management_ip_address: "204.1.1.1"
              new_host_name: "SR-LAN-9300-im1"
            - device_management_ip_address: "91.1.1.6"
              new_host_name: "Test"

- name: Add link for LAN Automated devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automated_device_update:
          link_add:
            source_device_management_ip_address: "204.1.1.1"
            source_device_interface_name: "HundredGigE1/0/2"
            destination_device_management_ip_address: "204.1.1.4"
            destination_device_interface_name: "HundredGigE1/0/5"
            ip_pool_name: "underlay_sj"

- name: Delete link between LAN Automated devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automated_device_update:
          link_delete:
            source_device_management_ip_address: "204.1.1.1"
            source_device_interface_name: "HundredGigE1/0/2"
            destination_device_management_ip_address: "204.1.1.4"
            destination_device_interface_name: "HundredGigE1/0/5"

- name: Apply loopback and hostname updates for LAN
    Automated devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - lan_automated_device_update:
          loopback_update_device_list:
            - device_management_ip_address: "204.1.1.160"
              new_loopback0_ip_address: "10.4.18.101"
          hostname_update_devices:
            - device_management_ip_address: "91.1.3.2"
              new_host_name: "SR-LAN-9300-SJ"
            - device_management_ip_address: "204.1.1.5"
              new_host_name: "SR-LAN-9500-SJ"

- name: Create a new Port Channel using Management IP address device identification
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            links:
              - source_port: GigabitEthernet1/0/1
                destination_port: GigabitEthernet2/0/1
              - source_port: GigabitEthernet1/0/2
                destination_port: GigabitEthernet2/0/2

- name: Create Port Channel using MAC address device identification
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          - source_device_mac_address: aa:bb:cc:dd:ee:01
            destination_device_mac_address: aa:bb:cc:dd:ee:02
            links:
              - source_port: TenGigabitEthernet1/0/1
                destination_port: TenGigabitEthernet1/0/1
              - source_port: TenGigabitEthernet1/0/2
                destination_port: TenGigabitEthernet1/0/2

- name: Create Port Channel using serial number device identification
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          - source_device_serial_number: FCW2140L056
            destination_device_serial_number: FCW2140L057
            links:
              - source_port: FortyGigabitEthernet1/0/1
                destination_port: FortyGigabitEthernet1/0/1

# Provide at least one existing link to identify the Port Channel.
- name: Update existing Port Channel by providing at least one existing link
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            links:
              # Existing link already part of the Port Channel
              - source_port: GigabitEthernet1/0/1
                destination_port: GigabitEthernet2/0/1
              # New link to be added
              - source_port: GigabitEthernet1/0/10
                destination_port: GigabitEthernet2/0/10

- name: Update a Port Channel using port_channel_number
  # No need to specify existing links when port_channel_number is provided.
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            port_channel_number: 1
            links:
              - source_port: GigabitEthernet1/0/10
                destination_port: GigabitEthernet2/0/10

- name: Delete all Port Channels between two devices
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1

- name: Delete a specific link from a Port Channel
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            links:
              - source_port: GigabitEthernet1/0/1
                destination_port: GigabitEthernet2/0/1            # This link will be removed from its associated Port Channel.

- name: Delete an entire Port Channel between two devices by specifying all the links
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            links:
              - source_port: GigabitEthernet1/0/1
                destination_port: GigabitEthernet2/0/1
              - source_port: GigabitEthernet1/0/2
                destination_port: GigabitEthernet2/0/2
              - source_port: GigabitEthernet1/0/3
                destination_port: GigabitEthernet2/0/3

- name: Delete an entire Port Channel between two devices by specifying the port_channel_number
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
            destination_device_management_ip_address: 20.1.1.1
            port_channel_number: 1

- name: Delete all Port Channels originating from a source device
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: deleted
    config:
      - port_channel:
          - source_device_management_ip_address: 10.1.1.1
          # Deletes every Port Channel from source device 10.1.1.1, regardless of destination.

- name: Complex Port Channel operations with multiple configurations
  cisco.dnac.lan_automation_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: true
    config_verify: false
    state: merged
    config:
      - port_channel:
          # First Port Channel between devices A and B
          - source_device_management_ip_address: "10.1.1.1"
            destination_device_management_ip_address: "20.1.1.1"
            links:
              - source_port: "GigabitEthernet1/0/1"
                destination_port: "GigabitEthernet2/0/1"
              - source_port: "GigabitEthernet1/0/2"
                destination_port: "GigabitEthernet2/0/2"
          # Second Port Channel between devices A and C
          - source_device_management_ip_address: "10.1.1.1"
            destination_device_management_ip_address: "30.1.1.1"
            links:
              - source_port: "GigabitEthernet1/0/3"
                destination_port: "GigabitEthernet3/0/1"
              - source_port: "GigabitEthernet1/0/4"
                destination_port: "GigabitEthernet3/0/2"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

dnac_response

dictionary

A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK

Returned: always

Sample: {"response": {"taskId": "string", "url": "string"}, "version": "string"}

Authors

  • Luna Aliaj (@majlona)

  • Madhan Sankaranarayanan (@madhansansel)

  • Archit Soni (@koderchit)