cisco.catalystcenter.global_credentials module -- Resource module for Global Credentials

Note

This module is part of the cisco.catalystcenter collection (version 2.11.0).

To install it, use: ansible-galaxy collection install cisco.catalystcenter. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.catalystcenter.global_credentials.

New in cisco.catalystcenter 2.3.0

Synopsis

  • Manage operations create, update and delete of the resource Global Credentials.

  • API to add new global credential.

  • API to delete global credential by the given identifier.

  • API to update the global credential by the given identifier.

Note

This module has a corresponding action plugin.

Requirements

The below requirements are needed on the host that executes this module.

  • catalystcentersdk >= 3.2.3.0.0

  • python >= 3.12

Parameters

Parameter

Comments

authPassword

string

Authentication password for SNMP. Required if the authentication type is specified. Passwords must contain minimum 8 characters and cannot contain spaces or angle brackets(<>). For wireless devices password of length 12 to 31 characters is required.

authType

string

SNMP authentication type. Required if the SNMP security mode is `AUTHPRIV` or `AUTHNOPRIV`. | SNMP authentication type| Description | |----------------------|-------------| |\`SHA\` | The device will be authenticated using SHA. | |\`MD5\` | The device will be authenticated using MD5.| |\`SHA256\` | The device will be authenticated using SHA256.|.

catalystcenter_debug

aliases: dnac_debug

boolean

Flag for Cisco Catalyst Center SDK to enable debugging.

Choices:

catalystcenter_host

aliases: dnac_host

string / required

The Cisco Catalyst Center hostname.

catalystcenter_password

aliases: dnac_password

string

The Cisco Catalyst Center password to authenticate.

catalystcenter_port

aliases: dnac_port, catalystcenter_api_port

integer

The Cisco Catalyst Center port.

Default: :ansible-option-default:`443`

catalystcenter_username

aliases: dnac_username, user

string

The Cisco Catalyst Center username to authenticate.

Default: :ansible-option-default:`"admin"`

catalystcenter_verify

aliases: dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

catalystcenter_version

aliases: dnac_version

string

Informs the SDK which version of Cisco Catalyst Center to use.

Default: :ansible-option-default:`"3.1.6.0"`

description

string

Description for NETCONF credential.

enablePassword

string

CLI Enable Password. Passwords cannot contain spaces or angle brackets(<>).

id

string

Id path parameter. Unique identifier of the global credential.

mode

string

password

string

HTTP(S) write password. Passwords cannot contain spaces or angle brackets(<>).

port

string

NETCONF port of the device.

privacyPassword

string

SNMP privacy password. Required if the privacy type is specified. Passwords must contain minimum 8 characters and cannot contain spaces or angle brackets(<>). For wireless devices password of length 12 to 31 characters is required.

privacyType

string

SNMP privacy type. Required if the SNMP mode is `AUTHPRIV`. | SNMP privacy type | Description | |------------------------------|--------------| | `AES128` | AES128 algorithm used for encryption. | | `AES192`| AES192 algorithm used for encryption. | | `AES256` | AES256 algorithm used for encryption.| | `CISCOAES192` | CISCOAES192 algorithm used for encryption.| | `CISCOAES256` | CISCOAES256 algorithm used for encryption.|.

protocol

string

HTTP protocol. Compute device require HTTPS.

readCommunity

string

Read-only community string password used to view SNMP information on the device. Passwords cannot contain spaces or angle brackets(<>).

type

string

Type of the credential. This attribute should not be provided as part of PUT API call, as `type` cannot be updated for credential.

username

string

HTTP(S) write username.

validate_response_schema

boolean

Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

writeCommunity

string

Read-write community string used to read and write SNMP information. Passwords cannot contain spaces or angle brackets(<>).

Notes

Note

  • SDK Method used are network_settings.NetworkSettings.adds_new_global_credential, network_settings.NetworkSettings.delete_global_credential_by_the_given_identifier, network_settings.NetworkSettings.update_global_credential_by_the_given_identifer,

  • Paths used are post /dna/intent/api/v1/globalCredentials, delete /dna/intent/api/v1/globalCredentials/{id}, put /dna/intent/api/v1/globalCredentials/{id},

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins,

  • but instead uses the embedded connection manager from Cisco CATALYST SDK

  • Requires Python >= 3.10, matching the controller Python versions supported by the collection's minimum ansible-core version (see the collection README for the current ansible-core / Python compatibility range)

See Also

See also

Cisco Catalyst Center documentation for Network Settings AddsNewGlobalCredential

Complete reference of the AddsNewGlobalCredential API.

Cisco Catalyst Center documentation for Network Settings DeleteGlobalCredentialByTheGivenIdentifier

Complete reference of the DeleteGlobalCredentialByTheGivenIdentifier API.

Cisco Catalyst Center documentation for Network Settings UpdateGlobalCredentialByTheGivenIdentifer

Complete reference of the UpdateGlobalCredentialByTheGivenIdentifer API.

Examples

---
- name: Delete by id
  cisco.catalystcenter.global_credentials:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: absent
    id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
- name: Update by id
  cisco.catalystcenter.global_credentials:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: present
    authPassword: string
    authType: string
    description: string
    enablePassword: string
    id: string
    mode: string
    password: string
    port: string
    privacyPassword: string
    privacyType: string
    protocol: string
    readCommunity: string
    type: string
    username: string
    writeCommunity: string
- name: Create
  cisco.catalystcenter.global_credentials:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    state: present
    authPassword: string
    authType: string
    description: string
    enablePassword: string
    id: string
    mode: string
    password: string
    port: string
    privacyPassword: string
    privacyType: string
    protocol: string
    readCommunity: string
    type: string
    username: string
    writeCommunity: string

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

catalystcenter_response

dictionary

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"}`

Authors

  • Bryan Vargas (@bvargasre)