cisco.dnac.inventory_intent module – Resource module for Network Device
Note
This module is part of the cisco.dnac collection (version 6.10.4).
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 |
---|---|
List of devices with credentails to perform Add/Update/Delete/Resync operation |
|
Status of Interface of a device, it can be (UP/DOWN). |
|
Required if need to delete the Provisioned device by clearing current configuration. Choices: |
|
The essential prerequisite for adding Network devices is the specification of the transport protocol (either SSH or Telnet) used by the device. |
|
Compute Device flag. Choices: |
|
Make this as true needed for the updation of device credentials and other device details. Choices: |
|
Preview/Deploy [Preview means the configuration is not pushed to the device. Deploy makes the configuration pushed to the device] Default: :ansible-option-default:`"Deploy"` |
|
Info about the global user defined field. Also used while updating interface details. |
|
Make this as true needed for the addition of device in inventory. Choices: |
|
Make this as true needed for the resyncing of device. Choices: |
|
Make this as true needed for the updation of device role, interface details, device credentails or details. Choices: |
|
Interface details of the wireless device |
|
The name identifier for the gateway associated with the interface. |
|
Ip Address allocated to the interface |
|
Name of the interface. |
|
The netmask of the interface, given in CIDR notation. This is an integer that represents the number of bits set in the netmask |
|
The Link Aggregation Group (LAG) number or port number assigned to the interface. |
|
The VLAN (Virtual Local Area Network) ID associated with the network interface. |
|
Device’s enable password. |
|
Device’s extended discovery info. |
|
If forcesync is true then device sync would run in high priority thread if available, else the sync will fail. Choices: |
|
A list of hostnames representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses. |
|
Device’s http password. Required for Adding Compute, Meraki, Firepower Management Devices. |
|
Device’s http port number. Required for Adding Compute, Firepower Management Devices. |
|
HttpSecure flag. Choices: |
|
Device’s http username. Required for Adding Compute,Firepower Management Devices. |
|
Specify the interface name to update the details of the device interface. (For example, GigabitEthernet1/0/11, FortyGigabitEthernet1/1/2) |
|
Device’s ipAddress. Required for Adding/Updating/Deleting/Resyncing Device except Meraki Devices. |
|
A list of MAC addresses representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses. |
|
Location of the sites allocated for the APs |
|
Name of Global User Defined Field. Required for creating/deleting UDF and then assigning it to device. |
|
Device’s netconf port. |
|
enum(CREDENTIALDETAILS, DEVICEDETAILS) 0 to export Device Credential Details Or 1 to export Device Details. |
|
List of device parameters that needs to be exported to file. |
|
Device’s password. Required for Adding Network Device. Also needed for file encryption while exporting device in a csv file. |
|
Make this as true needed for the Rebooting of Access Points. Choices: |
|
Role of device which can be ACCESS, CORE, DISTRIBUTION, BORDER ROUTER, UNKNOWN. Default: :ansible-option-default:`"ACCESS"` |
|
role source for the Device. Default: :ansible-option-default:`"AUTO"` |
|
Device’s serial number. |
|
A list of serial numbers representing devices. Operations such as updating, deleting, resyncing, or rebooting can be performed as alternatives to using IP addresses. |
|
Required for Provisioning of Wired and Wireless Devices. |
|
Device’s snmp auth passphrase. Required for Adding Network, Compute, Third Party Devices. |
|
Device’s snmp Auth Protocol. Default: :ansible-option-default:`"SHA"` |
|
Device’s snmp Mode. Default: :ansible-option-default:`"AUTHPRIV"` |
|
Device’s snmp Private Passphrase. Required for Adding Network, Compute, Third Party Devices. |
|
Device’s snmp Private Protocol. Required for Adding Network, Compute, Third Party Devices. Must be given in playbook if you are updating the device credentails. |
|
Device’s snmp Retry. Default: :ansible-option-default:`3` |
|
Device’s snmp ROCommunity. Required for Adding V2C Devices. Default: :ansible-option-default:`"public"` |
|
Device’s snmp RWCommunity. Required for Adding V2C Devices. Default: :ansible-option-default:`"private"` |
|
Device’s snmp Timeout. Default: :ansible-option-default:`5` |
|
Device’s snmp Username. Required for Adding Network, Compute, Third Party Devices. |
|
Device’s snmp Version. Default: :ansible-option-default:`"v3"` |
|
Select Device’s type from NETWORK_DEVICE, COMPUTE_DEVICE, MERAKI_DASHBOARD, THIRD_PARTY_DEVICE, FIREPOWER_MANAGEMENT_SYSTEM. |
|
Network Device’s update Mgmt IPaddress List. |
|
Device’s existing Mgmt IpAddress. |
|
Device’s new Mgmt IpAddress. |
|
Network Device’s username. Required for Adding Network Device. |
|
Value to assign to tag with or without the same user defined field name. |
|
Unique Id number assigned to a VLAN within a network. |
|
Identifier used to distinguish a specific VLAN that is dedicated to voice traffic. |
|
Set to True to verify the Cisco Catalyst Center config after applying the playbook config. Choices: |
|
Flag for Cisco DNA Center SDK to enable debugging. Choices: |
|
The Cisco DNA Center hostname. |
|
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: |
|
Determines the mode of the file. Set to True for ‘append’ mode. Set to False for ‘write’ mode. Choices: |
|
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: :ansible-option-default:`"dnac.log"` |
|
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: :ansible-option-default:`"WARNING"` |
|
The Cisco DNA Center password to authenticate. |
|
The Cisco DNA Center port. Default: :ansible-option-default:`"443"` |
|
The Cisco DNA Center username to authenticate. Default: :ansible-option-default:`"admin"` |
|
Flag to enable or disable SSL certificate verification. Choices: |
|
Informs the SDK which version of Cisco DNA Center to use. Default: :ansible-option-default:`"2.2.3.3"` |
|
The state of Cisco Catalyst Center after module completion. Choices: |
|
Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. Choices: |
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: string
compute_device: false
enable_password: string
extended_discovery_info: string
http_password: string
http_port: string
http_secure: false
http_username: string
ip_address:
- string
netconf_port: string
password: string
serial_number: string
snmp_auth_passphrase: string
snmp_auth_protocol: string
snmp_mode: string
snmp_priv_passphrase: string
snmp_priv_protocol: string
snmp_ro_community: string
snmp_rw_community: string
snmp_retry: 3
snmp_timeout: 5
snmp_username: string
snmp_version: string
type: string
device_added: true
username: string
- 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:
- string
http_username: string
http_password: string
http_port: string
snmp_auth_passphrase: string
snmp_auth_protocol: string
snmp_mode: string
snmp_priv_passphrase: string
snmp_priv_protocol: string
snmp_retry: 3
snmp_timeout: 5
snmp_username: string
compute_device: true
username: string
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: string
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:
- string
http_username: string
http_password: string
http_port: string
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:
- string
snmp_auth_passphrase: string
snmp_auth_protocol: string
snmp_mode: string
snmp_priv_passphrase: string
snmp_priv_protocol: string
snmp_retry: 3
snmp_timeout: 5
snmp_username: string
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: string
compute_device: false
password: string
enable_password: string
extended_discovery_info: string
http_password: string
http_port: string
http_secure: false
http_username: string
ip_address:
- string
netconf_port: string
serial_number: string
snmp_auth_passphrase: string
snmp_auth_protocol: string
snmp_mode: string
snmp_priv_passphrase: string
snmp_priv_protocol: string
snmp_username: string
snmp_version: string
type: string
device_updated: true
credential_update: true
update_mgmt_ipaddresslist:
- exist_mgmt_ipaddress: string
new_mgmt_ipaddress: string
username: string
- 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:
- string
credential_update: true
update_mgmt_ipaddresslist:
- exist_mgmt_ipaddress: string
new_mgmt_ipaddress: string
- 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:
- string
provision_wired_device:
site_name: string
- 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:
- string
provision_wireless_device:
- site_name: string
managed_ap_locations:
- string
dynamic_interfaces:
- interface_ip_address: string
interface_netmask_in_cidr: int
interface_gateway: string
lag_or_port_number: int
vlan_id: int
interface_name: string
- 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:
- string
device_updated: true
update_device_role:
role: string
role_source: string
- 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:
- string
device_updated: true
update_interface_details:
description: str
admin_status: str
vlan_id: int
voice_vlan_id: int
deployment_mode: str
interface_name: str
- 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:
- string
export_device_list:
password: str
operation_enum: str
parameters: str
- 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:
- string
add_user_defined_field:
name: string
description: string
value: string
- 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:
- string
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:
- string
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:
- string
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:
- string
add_user_defined_field:
name: string
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: :ansible-rv-sample-value:`{"response": {"taskId": "string", "url": "string"}, "version": "string"}` |