cisco.dnac.discovery_intent module – Resource module for discovery related functions
Note
This module is part of the cisco.dnac collection (version 6.10.0).
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.discovery_intent
.
New in cisco.dnac 6.6.0
Synopsis
Manage operations discover devices using IP address/range, CDP, LLDP and delete discoveries
API to discover a device or multiple devices
API to delete a discovery of a device or multiple devices
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk == 2.6.10
python >= 3.5
Parameters
Parameter |
Comments |
---|---|
List of details of device being managed. |
|
Total number of levels that are there in cdp’s method of discovery Default: :ansible-option-default:`16` |
|
List of devices with details necessary for discovering the devices. |
|
Management IP address of the device |
|
Hostname of the device |
|
Name of the discovery task |
|
Type of discovery (SINGLE/RANGE/MULTI RANGE/CDP/LLDP/CIDR) |
|
List of enable passwords for the CLI crfedentials |
|
HTTP read credentials for hosting a device |
|
HTTP write credentials for hosting a device |
|
List of IP adddrsess that needs to get filtered out from the IP addresses added |
|
Total number of levels that are there in lldp’s method of discovery Default: :ansible-option-default:`16` |
|
Port for the netconf credentials |
|
List of passwords for the CLI credentials |
|
Preferred method for the management of the IP (None/UseLoopBack) Default: :ansible-option-default:`"None"` |
|
Order of protocol (ssh/telnet) in which device connection will be tried. For example, ‘telnet’ - only telnet - ‘ssh, telnet’ - ssh with higher order than telnet |
|
Number of records to returnfor the header in fetching global v2 credentials |
|
Number of times to try establishing connection to device |
|
Auth Pass phrase for SNMP |
|
SNMP auth protocol (SHA/MD5) |
|
Mode of SNMP (AUTHPRIV/AUTHNOPRIV/NOAUTHNOPRIV) |
|
Pass phrase for SNMP privacy |
|
SNMP privacy protocol (DES/AES128) |
|
Snmp RO community of the devices to be discovered |
|
Description for Snmp RO community |
|
Snmp RW community of the devices to be discovered |
|
Description for Snmp RW community |
|
SNMP username of the device |
|
Version of SNMP (v2/v3) |
|
Start index for the header in fetching global v2 credentials |
|
Time to wait for device response in seconds |
|
List of passwords for the CLI credentials |
|
Flag for Cisco DNA Center SDK to enable debugging. Choices: |
|
The Cisco DNA Center hostname. |
|
Flag for logging playbook execution details. If set to true the log file will be created at the location of the execution with the name dnac.log Choices: |
|
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 DNAC 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 discovery.Discovery.get_all_global_credentials_v2, discovery.Discovery.start_discovery, task.Task.get_task_by_id, discovery.Discovery.get_discoveries_by_range, discovery.Discovery.get_discovered_network_devices_by_discovery_id’, discovery.Discovery.delete_discovery_by_id
Paths used are get /dna/intent/api/v2/global-credential post /dna/intent/api/v1/discovery get /dna/intent/api/v1/task/{taskId} get /dna/intent/api/v1/discovery/{startIndex}/{recordsToReturn} get /dna/intent/api/v1/discovery/{id}/network-device delete /dna/intent/api/v1/discovery/{id}
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
Examples
- name: Execute discovery devices
cisco.dnac.discovery_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: True
state: merged
config:
- device_list:
- name: string
ip: string
discovery_type: string
cdp_level: string
lldp_level: string
start_index: integer
enable_pasword_list: list
records_to_return: integer
http_read_credential: string
http_write_credential: string
ip_filter_list: list
discovery_name: string
password_list: list
preffered_mgmt_ip_method: string
protocol_order: string
retry: integer
snmp_auth_passphrase: string
snmp_auth_protocol: string
snmp_mode: string
snmp_priv_passphrse: string
snmp_priv_protocol: string
snmp_ro_community: string
snmp_ro_community_desc: string
snmp_rw_community: string
snmp_rw_community_desc: string
snmp_username: string
snmp_version: string
timeout: integer
username_list: list
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary with the response returned by the Cisco DNAC Python SDK Returned: always |
|
A list with the response returned by the Cisco DNAC Python SDK Returned: always Sample: :ansible-rv-sample-value:`["{\\n \\"response\\": []", "\\n \\"msg\\": String\\n}\\n"]` |
|
A string with the response returned by the Cisco DNAC Python SDK Returned: always Sample: :ansible-rv-sample-value:`"{\\n \\"response\\": String,\\n \\"msg\\": String\\n}\\n"` |
Authors
Abinash Mishra (@abimishr) Phan Nguyen (phannguy)