diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-18 05:52:27 +0000 |
commit | 3b0807ad7b283c46c21862eb826dcbb4ad04e5e2 (patch) | |
tree | 6461ea75f03eca87a5a90c86c3c9a787a6ad037e /ansible_collections/cisco/dnac/playbooks/discovery_intent.yml | |
parent | Adding debian version 7.7.0+dfsg-3. (diff) | |
download | ansible-3b0807ad7b283c46c21862eb826dcbb4ad04e5e2.tar.xz ansible-3b0807ad7b283c46c21862eb826dcbb4ad04e5e2.zip |
Merging upstream version 9.4.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ansible_collections/cisco/dnac/playbooks/discovery_intent.yml')
-rw-r--r-- | ansible_collections/cisco/dnac/playbooks/discovery_intent.yml | 197 |
1 files changed, 197 insertions, 0 deletions
diff --git a/ansible_collections/cisco/dnac/playbooks/discovery_intent.yml b/ansible_collections/cisco/dnac/playbooks/discovery_intent.yml new file mode 100644 index 000000000..9f004802f --- /dev/null +++ b/ansible_collections/cisco/dnac/playbooks/discovery_intent.yml @@ -0,0 +1,197 @@ +--- +- name: Discover devices using multiple discovery specific credentials and delete all the discoveries + hosts: localhost + connection: local + gather_facts: no + + vars_files: + - "{{ CLUSTERFILE }}" + + vars: + dnac_login: &dnac_login + 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: DEBUG + + tasks: + + - name: Execute discovery devices using MULTI RANGE with various global credentials + cisco.dnac.discovery_intent: + <<: *dnac_login + state: merged + config_verify: True + config: + - discovery_name: Multi_global + discovery_type: MULTI RANGE + ip_address_list: + - 204.1.2.1-204.1.2.5 + - 204.192.3.40 + - 204.192.4.200 + - 204.1.2.6 + - 204.1.2.7 + - 204.1.2.8 + - 204.1.2.9 + - 204.1.2.10 + - 204.1.2.11 + global_credentials: + cli_credentials_list: + - description: ISE + username: cisco + - description: CLI1234 #Incorrect name passed + username: cli + http_read_credential_list: + - description: HTTP Read + username: HTTP_Read + snmp_v3_credential_list: + - description: snmpV3 + username: snmpV3 + protocol_order: ssh + + - name: Execute discovery of single device using various discovery specific credentials and all the global credentials + cisco.dnac.discovery_intent: + <<: *dnac_login + state: merged + config_verify: True + config: + - discovery_name: Single IP Discovery + discovery_type: "SINGLE" + ip_address_list: + - 204.1.2.5 + discovery_specific_credentials: + cli_credentials_list: + - username: cisco + password: Cisco#123 + enable_password: Cisco#123 + http_read_credential: + username: string + password: Lablab#123 + port: 443 + secure: True + snmp_v2_read_credential: + desc: string + community: string + snmp_v2_write_credential: + desc: string + community: string + snmp_v3_credential: + username: v3Public2 + snmp_mode: AUTHPRIV + auth_type: SHA + auth_password: Lablab#1234 + privacy_type: AES256 + privacy_password: Lablab#1234 + protocol_order: ssh + + - name: Execute discovery of single device using various discovery specific credentials only + cisco.dnac.discovery_intent: + <<: *dnac_login + state: merged + config_verify: True + config: + - discovery_name: Single without Global Credentials + discovery_type: "SINGLE" + ip_address_list: + - 204.1.2.5 + use_global_credentials: False + discovery_specific_credentials: + cli_credentials_list: + - username: cisco + password: Cisco#123 + enable_password: Cisco#123 + http_read_credential: + username: string + password: Lablab#123 + port: 443 + secure: True + snmp_v2_read_credential: + desc: string + community: string + snmp_v2_write_credential: + desc: string + community: string + snmp_v3_credential: + username: v3Public2 + snmp_mode: AUTHPRIV + auth_type: SHA + auth_password: Lablab#1234 + privacy_type: AES256 + privacy_password: Lablab#1234 + protocol_order: ssh + + - name: Execute discovery devices using MULTI RANGE with various discovery specific credentials and all global credentials (max 5 allowed) + cisco.dnac.discovery_intent: + <<: *dnac_login + state: merged + config_verify: True + config: + - discovery_type: "MULTI RANGE" + discovery_name: Multi_range + ip_address_list: + - 204.1.2.1-204.1.2.100 #It will be taken as 204.1.2.1 - 204.1.2.1 + - 205.2.1.1-205.2.1.10 + ip_filter_list: + - 204.1.2.5 #Devie with IP 204.1.2.5 won't be discovered + discovery_specific_credentials: + cli_credentials_list: + - username: admin + password: maglev123 + enable_password: maglev123 + http_read_credential: + username: admin + password: maglev123 + port: 443 + secure: True + snmp_v2_read_credential: + desc: new + community: password + snmp_v3_credential: + username: administrator + snmp_mode: AUTHPRIV + auth_password: admin123 + auth_type: SHA + privacy_type: AES192 + privacy_password: cisco#123 + protocol_order: ssh + start_index: 1 + records_to_return: 1000 + snmp_version: v2 + + - name: Execute discovery devices using CDP/LLDP/CIDR leveraging discovery specific credentials and all the global credentials + cisco.dnac.discovery_intent: + <<: *dnac_login + state: merged + config_verify: True + config: + - discovery_name: CDP_Test_1 + discovery_type: "CDP" #Can be LLDP and CIDR + ip_address_list: #List length should be one + - 204.1.2.1 + cdp_level: 2 #Instead use lldp_level for LLDP and prefix length for CIDR + discovery_specific_credentials: + cli_credentials_list: + - username: admin + password: maglev123 + enable_password: maglev123 + protocol_order: ssh + + - name: Execute deletion of single discovery from the dashboard + cisco.dnac.discovery_intent: + <<: *dnac_login + state: deleted + config_verify: True + config: + - discovery_name: CDP_Test_1 + + - name: Execute deletion of all the discoveries from the dashboard + cisco.dnac.discovery_intent: + <<: *dnac_login + state: deleted + config_verify: True + config: + - delete_all: True
\ No newline at end of file |