cisco.dnac.device_credential_intent module -- Resource module for Global Device Credentials and Assigning Credentials to sites.
Note
This module is part of the cisco.dnac collection (version 6.24.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.device_credential_intent
.
New in cisco.dnac 6.7.0
Synopsis
Manage operations on Global Device Credentials and Assigning Credentials to sites.
API to create global device credentials.
API to update global device credentials.
API to delete global device credentials.
API to assign the device credential to the site.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk >= 2.7.2
python >= 3.9
Parameters
Parameter |
Comments |
---|---|
List of details of global device credentials and site names. |
|
Assign Device Credentials to Site. |
|
CLI Credential. |
|
CLI Credential Description. |
|
CLI Credential Id. Use (Description, Username) or Id. |
|
CLI Credential Username. |
|
HTTP(S) Read Credential |
|
HTTP(S) Read Credential Description. |
|
HTTP(S) Read Credential Id. Use (Description, Username) or Id. |
|
HTTP(S) Read Credential Username. |
|
HTTP(S) Write Credential |
|
HTTP(S) Write Credential Description. |
|
HTTP(S) Write Credential Id. Use (Description, Username) or Id. |
|
HTTP(S) Write Credential Username. |
|
Site Name to assign credential. |
|
SNMPv2c Read Credential |
|
SNMPv2c Read Credential Description. |
|
SNMPv2c Read Credential Id. Use Description or Id. |
|
SNMPv2c Write Credential |
|
SNMPv2c Write Credential Description. |
|
SNMPv2c Write Credential Id. Use Description or Id. |
|
snmp_v3 Credential |
|
snmp_v3 Credential Description. |
|
snmp_v3 Credential Id. Use Description or Id. |
|
Manages global device credentials |
|
Global Credential V2's cliCredential. |
|
Description. Required for creating the credential. |
|
cli_credential credential Enable Password. Password cannot contain spaces or angle brackets (< >) |
|
Credential Id. Use this for updating the device credential. |
|
Old Description. Use this for updating the description/Username. |
|
Old Username. Use this for updating the description/Username. |
|
cli_credential credential Password. Required for creating/updating the credential. Password cannot contain spaces or angle brackets (< >). |
|
cli_credential credential Username. Username cannot contain spaces or angle brackets (< >). |
|
Global Credential V2's httpsRead. |
|
Credential Id. Use this for updating the device credential. |
|
Name. Required for creating the credential. |
|
Old Description. Use this for updating the description/Username. |
|
Old Username. Use this for updating the description/Username. |
|
https_read credential Password. Required for creating/updating the credential. Password cannot contain spaces or angle brackets (< >). |
|
Port. Default port is 443. |
|
https_read credential Username. Username cannot contain spaces or angle brackets (< >). |
|
Global Credential V2's httpsWrite. |
|
Credential Id. Use this for updating the device credential. |
|
Name. Required for creating the credential. |
|
Old Description. Use this for updating the description/Username. |
|
Old Username. Use this for updating the description/Username. |
|
https_write credential Password. Required for creating/updating the credential. Password cannot contain spaces or angle brackets (< >). |
|
Port. Default port is 443. |
|
https_write credential Username. Username cannot contain spaces or angle brackets (< >). |
|
Global Credential V2's snmpV2cRead. |
|
Description. Required for creating the credential. |
|
Credential Id. Use this for updating the device credential. |
|
Old Description. Use this for updating the description. |
|
snmp_v2c_read Read Community. Password cannot contain spaces or angle brackets (< >). |
|
Global Credential V2's snmpV2cWrite. |
|
Description. Required for creating the credential. |
|
Credential Id. Use this for updating the device credential. |
|
Old Description. Use this for updating the description. |
|
snmp_v2c_write Write Community. Password cannot contain spaces or angle brackets (< >). |
|
Global Credential V2's snmpV3. |
|
snmp_v3 Auth Password. Password must contain minimum 8 characters. Password cannot contain spaces or angle brackets (< >). |
|
Auth Type. ["SHA", "MD5"]. |
|
snmp_v3 Description. Should be unique from other snmp_v3 credentials. |
|
Credential Id. Use this for updating the device credential. |
|
Old Description. Use this for updating the description. |
|
snmp_v3 Privacy Password. Password must contain minimum 8 characters. Password cannot contain spaces or angle brackets (< >). |
|
Privacy Type. ["AES128", "AES192", "AES256"]. |
|
Snmp Mode. ["AUTHPRIV", "AUTHNOPRIV", "NOAUTHNOPRIV"]. |
|
snmp_v3 credential Username. Username cannot contain spaces or angle brackets (< >). |
|
Set to True to verify the Cisco DNA Center after applying the playbook config. Choices: |
|
Defines the timeout in seconds for API calls to retrieve task details. If the task details are not received within this period, the process will end, and a timeout notification will be logged. Default: :ansible-option-default:`1200` |
|
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"` |
|
Specifies the interval in seconds between successive calls to the API to retrieve task details. Default: :ansible-option-default:`2` |
|
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 DNA 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 discovery.Discovery.create_global_credentials_v2, discovery.Discovery.delete_global_credential_v2, discovery.Discovery.update_global_credentials_v2, network_settings.NetworkSettings.assign_device_credential_to_site_v2,
Paths used are post /dna/intent/api/v2/global-credential, delete /dna/intent/api/v2/global-credential/{id}, put /dna/intent/api/v2/global-credential, post /dna/intent/api/v2/credential-to-site/{siteId},
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 DNA Center documentation for Discovery CreateGlobalCredentialsV2
Complete reference of the CreateGlobalCredentialsV2 API.
- Cisco DNA Center documentation for Discovery DeleteGlobalCredentialV2
Complete reference of the DeleteGlobalCredentialV2 API.
- Cisco DNA Center documentation for Discovery UpdateGlobalCredentialsV2
Complete reference of the UpdateGlobalCredentialsV2 API.
- Cisco DNA Center documentation for Network Settings AssignDeviceCredentialToSiteV2
Complete reference of the AssignDeviceCredentialToSiteV2 API.
Examples
---
- name: Create Credentials and assign it to a site.
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
- description: string
username: string
password: string
enable_password: string
snmp_v2c_read:
- description: string
read_community: string
snmp_v2c_write:
- description: string
write_community: string
snmp_v3:
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
https_read:
- description: string
username: string
password: string
port: 443
https_write:
- description: string
username: string
password: string
port: 443
assign_credentials_to_site:
cli_credential:
id: string
snmp_v2c_read:
id: string
snmp_v2c_write:
id: string
snmp_v3:
id: string
https_read:
id: string
https_write:
id: string
site_name:
- string
- name: Create Multiple Credentials.
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
- description: string
username: string
password: string
enable_password: string
- description: string
username: string
password: string
enable_password: string
snmp_v2c_read:
- description: string
read_community: string
- description: string
read_community: string
snmp_v2c_write:
- description: string
write_community: string
- description: string
write_community: string
snmp_v3:
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
https_read:
- description: string
username: string
password: string
port: 443
- description: string
username: string
password: string
port: 443
https_write:
- description: string
username: string
password: string
port: 443
- description: string
username: string
password: string
port: 443
- name: Update global device credentials using id
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
- description: string
username: string
password: string
enable_password: string
id: string
snmp_v2c_read:
- description: string
read_community: string
id: string
snmp_v2c_write:
- description: string
write_community: string
id: string
snmp_v3:
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
id: string
https_read:
- description: string
username: string
password: string
port: 443
id: string
https_write:
- description: string
username: string
password: string
port: 443
id: string
- name: Update multiple global device credentials using id
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
- description: string
username: string
password: string
enable_password: string
id: string
- description: string
username: string
password: string
enable_password: string
id: string
snmp_v2c_read:
- description: string
read_community: string
id: string
- description: string
read_community: string
id: string
snmp_v2c_write:
- description: string
write_community: string
id: string
- description: string
write_community: string
id: string
snmp_v3:
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
id: string
- auth_password: string
auth_type: SHA
snmp_mode: AUTHPRIV
privacy_password: string
privacy_type: AES128
username: string
description: string
id: string
https_read:
- description: string
username: string
password: string
port: 443
id: string
- description: string
username: string
password: string
port: 443
id: string
https_write:
- description: string
username: string
password: string
port: 443
id: string
- description: string
username: string
password: string
port: 443
id: string
- name: Update global device credential name/description using old name and description.
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- global_credential_details:
cli_credential:
- description: string
username: string
password: string
enable_password: string
old_description: string
old_username: string
snmp_v2c_read:
- description: string
read_community: string
old_description: string
snmp_v2c_write:
- description: string
write_community: string
old_description: string
snmp_v3:
- auth_password: string
auth_type: string
snmp_mode: string
privacy_password: string
privacy_type: string
username: string
description: string
https_read:
- description: string
username: string
password: string
port: string
old_description: string
old_username: string
https_write:
- description: string
username: string
password: string
port: string
old_description: string
old_username: string
- name: Assign Credentials to sites using old description and username.
cisco.dnac.device_credential_intent:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_log: True
dnac_log_level: "{{ dnac_log_level }}"
state: merged
config_verify: True
config:
- assign_credentials_to_site:
cli_credential:
description: string
username: string
snmp_v2c_read:
description: string
snmp_v2c_write:
description: string
snmp_v3:
description: string
https_read:
description: string
username: string
https_write:
description: string
username: string
site_name:
- string
- 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 DNAC Python SDK Returned: always Sample: :ansible-rv-sample-value:`{"response": {"taskId": "string", "url": "string"}, "version": "string"}` |
|
A dictionary or list with the response returned by the Cisco DNAC Python SDK Returned: always Sample: :ansible-rv-sample-value:`{"response": {"taskId": "string", "url": "string"}, "version": "string"}` |