cisco.dnac.discovery_intent module – Resource module for discovery related functions
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.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` |
|
Specifies the total number of CLI credentials to be used, ranging from 1 to 5. Default: :ansible-option-default:`1` |
|
Parameter to delete all the discoveries at one go Choices: |
|
Name of the discovery task |
|
Type of discovery (SINGLE/RANGE/MULTI RANGE/CDP/LLDP) |
|
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 addresses to be discoverred. |
|
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 return for the header in fetching global v2 credentials Default: :ansible-option-default:`100` |
|
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 SNMP v2 credentials Default: :ansible-option-default:`1` |
|
Time to wait for device response in seconds |
|
List of passwords for the CLI credentials |
|
Set to True to verify the Cisco DNA 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 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 discovery.Discovery.delete_all_discovery discovery.Discovery.get_count_of_all_discovery_jobs
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} delete /dna/intent/api/v1/delete get /dna/intent/api/v1/discovery/count
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
dnac_log_level: "{{dnac_log_level}}"
state: merged
config_verify: True
config:
- ip_address_list: list
discovery_type: string
cdp_level: string
lldp_level: string
start_index: integer
enable_password_list: list
records_to_return: integer
http_read_credential: dict
http_write_credential: dict
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_passphrase: 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
cli_cred_len: integer
- name: Delete disovery by name
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
dnac_log_level: "{{dnac_log_level}}"
state: deleted
config_verify: True
config:
- discovery_name: string
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)