cisco.dnac.global_credential_v2 模块 – 全局凭据 V2 资源模块

注意

此模块是 cisco.dnac 集合 (版本 6.25.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.dnac。您需要满足其他要求才能使用此模块,有关详细信息,请参阅 要求

要在剧本中使用它,请指定:cisco.dnac.global_credential_v2

cisco.dnac 3.1.0 中的新增功能

概要

  • 管理全局凭据 V2 资源的创建、更新和删除操作。

  • 用于创建新的全局凭据的 API。可以一次传递多种类型的多个凭据。请参阅示例请求正文以获取更多信息。

  • 删除全局凭据。只需要传递凭据的“id”。

  • 用于更新设备凭据的 API。可以一次传递多个凭据,但一次只能传递给定类型的一个凭据。请参阅示例请求正文以获取更多信息。

注意

此模块具有相应的 action 插件

要求

执行此模块的主机需要以下要求。

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

cliCredential

字典

全局凭据 V2 的 cliCredential。

description

字符串

CLI 凭据的描述。

enablePassword

字符串

CLI Enable 密码。

id

字符串

CLI 凭据的 UUID 格式 ID。

password

字符串

CLI 密码。

username

字符串

CLI 用户名。

dnac_debug

布尔值

用于 Cisco DNA Center SDK 的标志,用于启用调试。

选项

  • false ← (默认)

  • true

dnac_host

字符串 / 必需

Cisco DNA Center 主机名。

dnac_password

字符串

用于身份验证的 Cisco DNA Center 密码。

dnac_port

整数

Cisco DNA Center 端口。

默认值: 443

dnac_username

别名:user

字符串

用于身份验证的 Cisco DNA Center 用户名。

默认值: "admin"

dnac_verify

布尔值

启用或禁用 SSL 证书验证的标志。

选项

  • false

  • true ← (默认)

dnac_version

字符串

告知 SDK 使用哪个版本的 Cisco DNA Center。

默认值: "2.3.7.6"

httpsRead

字典

全局凭据 V2 的 httpsRead。

description

字符串

HTTP(S) 读取凭据的描述。

id

字符串

HTTP(S) 读取凭据的 UUID 格式 ID。

password

字符串

HTTP(S) 读取密码。

port

整数

HTTP(S) 端口。

username

字符串

HTTP(S) 读取用户名。

httpsWrite

字典

全局凭据 V2 的 httpsWrite。

description

字符串

HTTP(S) 写入凭据的描述。

id

字符串

HTTP(S) 读取凭据的 UUID 格式 ID。

password

字符串

HTTP(S) 写入密码。

port

整数

HTTP(S) 端口。

username

字符串

HTTP(S) 写入用户名。

id

字符串

ID 路径参数。全局凭据 ID。

snmpV2cRead

字典

全局凭据 V2 的 snmpV2cRead。

description

字符串

SNMP RO 社区的描述。

id

字符串

SNMP 读取凭据的 UUID 格式 ID。

readCommunity

字符串

SNMP RO 社区。

snmpV2cWrite

字典

全局凭据 V2 的 snmpV2cWrite。

description

字符串

SNMP RW 社区的描述。

id

字符串

SNMP 写入凭据的 UUID 格式 ID。

writeCommunity

字符串

SNMP RW 社区。

snmpV3

字典

全局凭据 V2 的 snmpV3。

authPassword

字符串

SNMP V3 的身份验证密码。

authType

字符串

SNMP 身份验证协议。“SHA”或“MD5”。

description

字符串

SNMP V3 凭据的描述。

id

字符串

SNMP V3 凭据的 UUID 格式 ID。

privacyPassword

字符串

SNMP 隐私的隐私密码。

privacyType

字符串

SNMP 隐私协议。“AES128”、“AES192”、“AES256”。

snmpMode

字符串

SNMP 模式。“AUTHPRIV”或“AUTHNOPRIV”或“NOAUTHNOPRIV”。

username

字符串

SNMP V3 用户名。

validate_response_schema

布尔值

用于 Cisco DNA Center SDK 的标志,用于启用根据 JSON 模式验证请求正文。

选项

  • false

  • true ← (默认)

备注

注意

  • 使用的 SDK 方法为 discovery.Discovery.create_global_credentials_v2、discovery.Discovery.delete_global_credential_v2、discovery.Discovery.update_global_credentials_v2,

  • 使用的路径为 post /dna/intent/api/v2/global-credential、delete /dna/intent/api/v2/global-credential/{id}、put /dna/intent/api/v2/global-credential,

  • 不支持 check_mode

  • 此插件运行在控制节点上,不使用任何 Ansible 连接插件,而是使用 Cisco DNAC SDK 的嵌入式连接管理器。

  • 以 dnac_ 开头的参数由 Cisco DNAC Python SDK 用于建立连接。

另请参见

另请参见

Cisco DNA Center 文档,关于 Discovery CreateGlobalCredentialsV2

CreateGlobalCredentialsV2 API 的完整参考。

Cisco DNA Center 文档,关于 Discovery DeleteGlobalCredentialV2

DeleteGlobalCredentialV2 API 的完整参考。

Cisco DNA Center 文档,关于 Discovery UpdateGlobalCredentialsV2

UpdateGlobalCredentialsV2 API 的完整参考。

示例

- name: Update all
  cisco.dnac.global_credential_v2:
    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}}"
    state: present
    cliCredential:
      description: string
      enablePassword: string
      id: string
      password: string
      username: string
    httpsRead:
      description: string
      id: string
      password: string
      port: 0
      username: string
    httpsWrite:
      description: string
      id: string
      password: string
      port: 0
      username: string
    snmpV2cRead:
      description: string
      id: string
      readCommunity: string
    snmpV2cWrite:
      description: string
      id: string
      writeCommunity: string
    snmpV3:
      authPassword: string
      authType: string
      description: string
      id: string
      privacyPassword: string
      privacyType: string
      snmpMode: string
      username: string

- name: Create
  cisco.dnac.global_credential_v2:
    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}}"
    state: present
    cliCredential:
    - description: string
      enablePassword: string
      password: string
      username: string
    httpsRead:
    - description: string
      password: string
      port: 0
      username: string
    httpsWrite:
    - description: string
      password: string
      port: 0
      username: string
    snmpV2cRead:
    - description: string
      readCommunity: string
    snmpV2cWrite:
    - description: string
      writeCommunity: string
    snmpV3:
    - authPassword: string
      authType: string
      description: string
      privacyPassword: string
      privacyType: string
      snmpMode: string
      username: string

- name: Delete by id
  cisco.dnac.global_credential_v2:
    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}}"
    state: absent
    id: string

返回值

常见的返回值已在 此处 记录,以下是此模块特有的字段:

描述

dnac_response

字典

Cisco DNAC Python SDK 返回的响应字典或列表。

返回值:始终返回

示例: {"response": {"taskId": "string", "url": "string"}, "version": "string"}

作者

  • Rafael Campos (@racampos)