cisco.dnac.inventory_intent module – Resource module for Network Device

Note

This module is part of the cisco.dnac collection (version 6.11.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.inventory_intent.

New in cisco.dnac 6.8.0

Synopsis

  • Manage operations create, update and delete of the resource Network Device.

  • Adds the device with given credential.

  • Deletes the network device for the given Id.

  • Sync the devices provided as input.

Requirements

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

  • dnacentersdk >= 2.5.5

  • python >= 3.5

Parameters

Parameter

Comments

config

list / elements=dictionary / required

List of devices with credentails to perform Add/Update/Delete/Resync operation

admin_status

string

Status of Interface of a device, it can be (UP/DOWN).

clean_config

boolean

Required if need to delete the Provisioned device by clearing current configuration.

Choices:

  • false ← (default)

  • true

cli_transport

string

The essential prerequisite for adding Network devices is the specification of the transport protocol (either SSH or Telnet) used by the device.

compute_device

boolean

Indicates whether a device is a compute device.

Choices:

  • false

  • true

credential_update

boolean

Make this as true needed for the updation of device credentials and other device details.

Choices:

  • false ← (default)

  • true

deployment_mode

string

Preview/Deploy [Preview means the configuration is not pushed to the device. Deploy makes the configuration pushed to the device]

Default: "Deploy"

description

string

Info about the global user defined field. Also used while updating interface details.

device_added

boolean

Make this as true needed for the addition of device in inventory.

Choices:

  • false ← (default)

  • true

device_resync

boolean

Make this as true needed for the resyncing of device.

Choices:

  • false ← (default)

  • true

device_updated

boolean

Make this as true needed for the updation of device role, interface details, device credentails or details.

Choices:

  • false ← (default)

  • true

dynamic_interfaces

list / elements=dictionary

Interface details of the wireless device

interface_gateway

string

The name identifier for the gateway associated with the interface.

interface_ip_address

string

Ip Address allocated to the interface

interface_name

string

Name of the interface.

interface_netmask_in_cidr

integer

The netmask of the interface, given in CIDR notation. This is an integer that represents the number of bits set in the netmask

lag_or_port_number

integer

The Link Aggregation Group (LAG) number or port number assigned to the interface.

vlan_id

integer

The VLAN (Virtual Local Area Network) ID associated with the network interface.

enable_password

string

Password required for enabling configurations on the device.

extended_discovery_info

string

Additional discovery information for the device.

force_sync

boolean

If forcesync is true then device sync would run in high priority thread if available, else the sync will fail.

Choices:

  • false ← (default)

  • true

hostname_list

list / elements=string

A list of hostnames representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses.

http_password

string

HTTP password required for adding compute, Meraki, and Firepower Management Devices.

http_port

string

HTTP port number required for adding compute and Firepower Management Devices.

http_secure

boolean

Flag indicating HTTP security.

Choices:

  • false

  • true

http_username

string

HTTP username required for adding compute and Firepower Management Devices.

interface_name

list / elements=string

Specify the list of interface names to update the details of the device interface. (For example, GigabitEthernet1/0/11, FortyGigabitEthernet1/1/2)

ip_address

list / elements=string

IP address of the device. Required for Adding/Updating/Deleting/Resyncing Device except Meraki Devices.

mac_address_list

list / elements=string

A list of MAC addresses representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses.

managed_ap_locations

list / elements=string

Location of the sites allocated for the APs

name

string

Name of Global User Defined Field. Required for creating/deleting UDF and then assigning it to device.

netconf_port

string

Specifies the port number for connecting to devices using the Netconf protocol. Netconf (Network Configuration Protocol) is used for managing network devices. Ensure that the provided port number corresponds to the Netconf service port configured on your network devices.

operation_enum

string

enum(CREDENTIALDETAILS, DEVICEDETAILS) 0 to export Device Credential Details Or 1 to export Device Details. CREDENTIALDETAILS - Used for exporting device credentials details like snpm credntials, device crdentails etc. DEVICEDETAILS - Used for exporting device specific details like device hostname, serial number, type, family etc.

parameters

list / elements=string

List of device parameters that needs to be exported to file.

password

string

Password for accessing the device and for file encryption during device export. Required for adding Network Device. Also needed for file encryption while exporting device in a csv file.

reboot_device

boolean

Make this as true needed for the Rebooting of Access Points.

Choices:

  • false ← (default)

  • true

role

string

Role of device which can be ACCESS, CORE, DISTRIBUTION, BORDER ROUTER, UNKNOWN. ALL - This role typically represents all devices within the network, regardless of their specific roles or functions. UNKNOWN - This role is assigned to devices whose roles or functions have not been identified or classified within Cisco Catalsyt Center. This could happen if the platform is unable to determine the device’s role based on available information. ACCESS - This role typically represents switches or access points that serve as access points for end-user devices to connect to the network. These devices are often located at the edge of the network and provide connectivity to end-user devices. BORDER ROUTER - These are devices that connect different network domains or segments together. They often serve as gateways between different networks, such as connecting an enterprise network to the internet or connecting multiple branch offices. DISTRIBUTION - This role represents function as distribution switches or routers in hierarchical network designs. They aggregate traffic from access switches and route it toward the core of the network or toward other distribution switches. CORE - This role typically represents high-capacity switches or routers that form the backbone of the network. They handle large volumes of traffic and provide connectivity between different parts of network, such as connecting distribution switches or providing interconnection between different network segments.

Default: "ACCESS"

role_source

string

Role source for the device.

Default: "AUTO"

serial_number

string

Serial number of the device.

serial_number_list

list / elements=string

A list of serial numbers representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses.

site_name

string

Required for Provisioning of Wired and Wireless Devices.

snmp_auth_passphrase

string

SNMP authentication passphrase required for adding network, compute, and third-party devices.

snmp_auth_protocol

string

SNMP authentication protocol. SHA (Secure Hash Algorithm) - cryptographic hash function commonly used for data integrity verification and authentication purposes. MD5 (Message Digest Algorithm 5) - cryptographic hash function commonly used for data integrity verification and authentication purposes.

Default: "SHA"

snmp_mode

string

Device’s snmp Mode refer to different SNMP (Simple Network Management Protocol) versions and their corresponding security levels. NOAUTHNOPRIV - This mode provides no authentication or encryption for SNMP messages. It means that devices communicating using SNMPv1 do not require any authentication (username/password) or encryption (data confidentiality). This makes it the least secure option. AUTHNOPRIV - This mode provides authentication but no encryption for SNMP messages. Authentication involves validating the source of the SNMP messages using a community string (similar to a password). However, the data transmitted between devices is not encrypted, so it’s susceptible to eavesdropping. AUTHPRIV - This mode provides both authentication and encryption for SNMP messages. It offers the highest level of security among the three options. Authentication ensures that the source of the messages is genuine, and encryption ensures that the data exchanged between devices is confidential and cannot be intercepted by unauthorized parties.

snmp_priv_passphrase

string

SNMP private passphrase required for adding network, compute, and third-party devices.

snmp_priv_protocol

string

SNMP private protocol required for adding network, compute, and third-party devices.

snmp_retry

integer

SNMP retry count.

Default: 3

snmp_ro_community

string

SNMP Read-Only community required for adding V2C devices.

Default: "public"

snmp_rw_community

string

SNMP Read-Write community required for adding V2C devices.

Default: "private"

snmp_timeout

integer

SNMP timeout duration.

Default: 5

snmp_username

string

SNMP username required for adding network, compute, and third-party devices.

snmp_version

string

Device’s snmp Version.

Default: "v3"

type

string

Select Device’s type from NETWORK_DEVICE, COMPUTE_DEVICE, MERAKI_DASHBOARD, THIRD_PARTY_DEVICE, FIREPOWER_MANAGEMENT_SYSTEM. NETWORK_DEVICE - This refers to traditional networking equipment such as routers, switches, access points, and firewalls. These devices are responsible for routing, switching, and providing connectivity within the network. COMPUTE_DEVICE - These are computing resources such as servers, virtual machines, or containers that are part of the network infrastructure. Cisco DNA Center can integrate with compute devices to provide visibility and management capabilities, ensuring that the network and compute resources work together seamlessly to support applications and services. MERAKI_DASHBOARD - It is cloud-based platform used to manage Meraki networking devices, including wireless access points, switches, security appliances, and cameras. THIRD_PARTY_DEVICE - This category encompasses devices from vendors other than Cisco or Meraki. Cisco DNA Center is designed to support integration with third-party devices through open standards and APIs. This allows organizations to manage heterogeneous network environments efficiently using Cisco DNA Center’s centralized management and automation capabilities. FIREPOWER_MANAGEMENT_SYSTEM - It is a centralized management console used to manage Cisco’s Firepower Next-Generation Firewall (NGFW) devices. It provides features such as policy management, threat detection, and advanced security analytics.

Default: "NETWORK_DEVICE"

update_mgmt_ipaddresslist

list / elements=dictionary

List of updated management IP addresses for network devices.

exist_mgmt_ipaddress

string

Device’s existing Mgmt IpAddress.

new_mgmt_ipaddress

string

Device’s new Mgmt IpAddress.

username

string

Username for accessing the device. Required for Adding Network Device.

value

string

Value to assign to tag with or without the same user defined field name.

vlan_id

integer

Unique Id number assigned to a VLAN within a network used only while updating interface details.

voice_vlan_id

integer

Identifier used to distinguish a specific VLAN that is dedicated to voice traffic used only while updating interface details.

config_verify

boolean

Set to True to verify the Cisco Catalyst Center config after applying the playbook config.

Choices:

  • false ← (default)

  • true

dnac_debug

boolean

Flag for Cisco DNA Center SDK to enable debugging.

Choices:

  • false ← (default)

  • true

dnac_host

string / required

The Cisco DNA Center hostname.

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 Cisco DNA Center password to authenticate.

dnac_port

string

The Cisco DNA Center port.

Default: "443"

dnac_username

aliases: user

string

The Cisco DNA Center username to authenticate.

Default: "admin"

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

  • false

  • true ← (default)

dnac_version

string

Informs the SDK which version of Cisco DNA Center to 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 DNA Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

  • false

  • true ← (default)

Notes

Note

  • SDK Method used are devices.Devices.add_device, devices.Devices.delete_device_by_id, devices.Devices.sync_devices,

  • Paths used are post /dna/intent/api/v1/network-device, delete /dna/intent/api/v1/network-device/{id}, put /dna/intent/api/v1/network-device,

  • Removed ‘managementIpAddress’ options in v4.3.0.

  • Does not support check_mode

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

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

See Also

See also

Cisco Catalyst Center documentation for Devices AddDevice2

Complete reference of the AddDevice2 API.

Cisco Catalyst Center documentation for Devices DeleteDeviceById

Complete reference of the DeleteDeviceById API.

Cisco Catalyst Center documentation for Devices SyncDevices2

Complete reference of the SyncDevices2 API.

Examples

- name: Add new device in Inventory with full credentials
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - cli_transport: ssh
        compute_device: False
        password: Test@123
        enable_password: Test@1234
        extended_discovery_info: test
        http_username: "testuser"
        http_password: "test"
        http_port: "443"
        http_secure: False
        ip_address: ["1.1.1.1", "2.2.2.2"]
        netconf_port: 830
        serial_number: FJC2327U0S2
        snmp_auth_passphrase: "Lablab@12"
        snmp_auth_protocol: SHA
        snmp_mode: AUTHPRIV
        snmp_priv_passphrase: "Lablab@123"
        snmp_priv_protocol: AES256
        snmp_retry: 3
        snmp_timeout: 5
        snmp_username: v3Public
        snmp_version: v3
        type: NETWORK_DEVICE
        device_added: True
        username: cisco

- name: Add new Compute device in Inventory with full credentials.Inputs needed for Compute Device
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        http_username: "testuser"
        http_password: "test"
        http_port: "443"
        snmp_auth_passphrase: "Lablab@12"
        snmp_auth_protocol: SHA
        snmp_mode: AUTHPRIV
        snmp_priv_passphrase: "Lablab@123"
        snmp_priv_protocol: AES256
        snmp_retry:  3
        snmp_timeout: 5
        snmp_username: v3Public
        compute_device: True
        username: cisco
        device_added: True
        type: "COMPUTE_DEVICE"

- name: Add new Meraki device in Inventory with full credentials.Inputs needed for Meraki Device.
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - http_password: "test"
        device_added: True
        type: "MERAKI_DASHBOARD"

- name: Add new Firepower Management device in Inventory with full credentials.Input needed to add Device.
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        http_username: "testuser"
        http_password: "test"
        http_port: "443"
        device_added: True
        type: "FIREPOWER_MANAGEMENT_SYSTEM"

- name: Add new Third Party device in Inventory with full credentials.Input needed to add Device.
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        snmp_auth_passphrase: "Lablab@12"
        snmp_auth_protocol: SHA
        snmp_mode: AUTHPRIV
        snmp_priv_passphrase: "Lablab@123"
        snmp_priv_protocol: AES256
        snmp_retry:  3
        snmp_timeout: 5
        snmp_username: v3Public
        device_added: True
        type: "THIRD_PARTY_DEVICE"

- name: Update device details or credentails in Inventory
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - cli_transport: telnet
        compute_device: False
        password: newtest123
        enable_password: newtest1233
        ip_address: ["1.1.1.1", "2.2.2.2"]
        type: NETWORK_DEVICE
        device_updated: True
        credential_update: True

- name: Update new management IP address of device in inventory
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - device_updated: True
        ip_address: ["1.1.1.1"]
        credential_update: True
        update_mgmt_ipaddresslist:
        - exist_mgmt_ipaddress: "1.1.1.1"
          new_mgmt_ipaddress: "12.12.12.12"

- name: Associate Wired Devices to site and Provisioned it in Inventory
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        provision_wired_device:
          site_name: "Global/USA/San Francisco/BGL_18/floor_pnp"

- name: Associate Wireless Devices to site and Provisioned it in Inventory
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        provision_wireless_device:
          site_name: ["Global/USA/BGL_18/floor_pnp", "Global/USA/BGL_18/floor_test"]
        managed_ap_locations: ["Global/USA/BGL_18/floor_pnp", "Global/USA/BGL_18/floor_test"]
        dynamic_interfaces:
        - interface_ip_address: 23.23.21.12
          interface_netmask_in_cidr: 24
          interface_gateway: "gateway"
          lag_or_port_number: 12
          vlan_id: 99
          interface_name: "etherenet0/0"

- name: Update Device Role with IP Address
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        device_updated: True
        update_device_role:
          role: ACCESS
          role_source: AUTO

- name: Update Interface details with IP Address
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        device_updated: True
        update_interface_details:
          description: "Testing for updating interface details"
          admin_status: "UP"
          vlan_id: 23
          voice_vlan_id: 45
          deployment_mode: "Deploy"
          interface_name: ["GigabitEthernet1/0/11", FortyGigabitEthernet1/1/1]

- name: Export Device Details in a CSV file Interface details with IP Address
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        export_device_list:
          password: "File_password"
          operation_enum: 0
          parameters: ["componentName", "SerialNumber", "Last Sync Status"]

- name: Create Global User Defined with IP Address
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        add_user_defined_field:
        - name: Test123
          description: "Added first udf for testing"
          value: "value123"
        - name: Test321
          description: "Added second udf for testing"
          value: "value321"

- name: Resync Device with IP Addresses
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        device_resync: True
        force_sync: False

- name: Reboot AP Devices with IP Addresses
  cisco.dnac.inventory_intent:
    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: False
    state: merged
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        reboot_device: True

- name: Delete Provision/Unprovision Devices by IP Address
  cisco.dnac.inventory_intent:
    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: False
    dnac_log_level: "{{dnac_log_level}}"
    state: deleted
    config:
      - ip_address: ["1.1.1.1", "2.2.2.2"]
        clean_config: False

- name: Delete Global User Defined Field with name
  cisco.dnac.inventory_intent:
    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: False
    state: deleted
    config:
    - ip_address: ["1.1.1.1", "2.2.2.2"]
      add_user_defined_field:
        - name: Test123
        - name: Test321

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

  • Abhishek Maheshwari (@abmahesh) Madhan Sankaranarayanan (@madhansansel)