cisco.dnac.device_credential_v1 模块 – 设备凭证 V1 的资源模块

注意

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

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

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

要在 Playbook 中使用它,请指定:cisco.dnac.device_credential_v1

cisco.dnac 3.1.0 中的新增功能

概要

  • 管理资源设备凭证 V1 的创建、更新和删除操作。

  • 用于创建设备凭证的 API。此 API 已被弃用,并且在 2024 年 8 月 1 日 23:59:59 GMT 之后的 Cisco DNA Center 版本中将不可用。请参考新的 Intent API 创建全局凭证 V2。

  • 删除设备凭证。此 API 已被弃用,并且在 2024 年 8 月 1 日 23:59:59 GMT 之后的 Cisco DNA Center 版本中将不可用。请参考新的 Intent API 删除全局凭证 V2。

  • 用于更新设备凭证的 API。此 API 已被弃用,并且在 2024 年 8 月 1 日 23:59:59 GMT 之后的 Cisco DNA Center 版本中将不可用。请参考新的 Intent API 更新全局凭证 V2。

注意

此模块具有相应的 操作插件

要求

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

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

dnac_debug

boolean

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

选择

  • false ← (默认)

  • true

dnac_host

string / 必需

Cisco DNA Center 主机名。

dnac_password

string

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

dnac_port

integer

Cisco DNA Center 端口。

默认值: 443

dnac_username

别名:user

string

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

默认值: "admin"

dnac_verify

boolean

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

选择

  • false

  • true ← (默认)

dnac_version

string

通知 SDK 要使用的 Cisco DNA Center 版本。

默认值: "2.3.7.6"

id

string

Id 路径参数。全局凭证 id。

settings

dictionary

设备凭证的设置。

cliCredential

list / elements=dictionary

设备凭证的 cliCredential。

description

string

CLI 凭证的名称或描述。

enablePassword

string

CLI 凭证的启用密码。

password

string

CLI 凭证的密码。

username

string

CLI 凭证的用户名。

httpsRead

list / elements=dictionary

设备凭证的 httpsRead。

name

string

http 读取凭证的名称或描述。

password

string

http 读取凭证的密码。

port

float

http 读取凭证的端口。

username

string

http 读取凭证的用户名。

httpsWrite

list / elements=dictionary

设备凭证的 httpsWrite。

name

string

http 写入凭证的名称或描述。

password

string

http 写入凭证的密码。

port

float

http 写入凭证的端口。

username

string

http 写入凭证的用户名。

snmpV2cRead

list / elements=dictionary

设备凭证的 snmpV2cRead。

description

string

snmp v2 读取的描述。

readCommunity

string

snmp v2 读取凭证的读取团体。

snmpV2cWrite

list / elements=dictionary

设备凭证的 snmpV2cWrite。

description

string

snmp v2 写入的描述。

writeCommunity

string

snmp v2 写入凭证的写入团体。

snmpV3

list / elements=dictionary

设备凭证的 snmpV3。

authPassword

string

snmpv3 凭证的身份验证密码。

authType

string

snmpv3 凭证的身份验证类型。

description

string

SNMPV3 凭证的名称或描述。

privacyPassword

string

snmpv3 凭证的隐私密码。

privacyType

string

snmpv3 凭证的隐私类型。

snmpMode

string

snmpv3 凭证的模式。

username

string

SNMPv3 凭证的用户名。

validate_response_schema

boolean

用于 Cisco DNA Center SDK 以启用针对 JSON 架构验证请求主体的标志。

选择

  • false

  • true ← (默认)

注释

注意

  • 使用的 SDK 方法是 network_settings.NetworkSettings.create_device_credentials_v1、network_settings.NetworkSettings.delete_device_credential_v1、network_settings.NetworkSettings.update_device_credentials_v1,

  • 使用的路径是 post /dna/intent/api/v1/device-credential、delete /dna/intent/api/v1/device-credential/{id}、put /dna/intent/api/v1/device-credential,

  • 不支持 check_mode

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

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

另请参阅

另请参阅

Cisco DNA Center 文档,关于网络设置 CreateDeviceCredentialsV1

CreateDeviceCredentialsV1 API 的完整参考。

Cisco DNA Center 文档,关于网络设置 DeleteDeviceCredentialV1

DeleteDeviceCredentialV1 API 的完整参考。

Cisco DNA Center 文档,关于网络设置 UpdateDeviceCredentialsV1

UpdateDeviceCredentialsV1 API 的完整参考。

示例

- name: Create
  cisco.dnac.device_credential_v1:
    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
    settings:
      cliCredential:
      - description: string
        enablePassword: string
        password: string
        username: string
      httpsRead:
      - name: string
        password: string
        port: 0
        username: string
      httpsWrite:
      - name: 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: Update all
  cisco.dnac.device_credential_v1:
    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
    settings:
      cliCredential:
        description: string
        enablePassword: string
        id: string
        password: string
        username: string
      httpsRead:
        id: string
        name: string
        password: string
        port: string
        username: string
      httpsWrite:
        id: string
        name: string
        password: string
        port: string
        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: Delete by id
  cisco.dnac.device_credential_v1:
    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

dictionary

一个字典或列表,包含 Cisco DNAC Python SDK 返回的响应

返回: 始终

示例: {"executionId": "string", "executionStatusUrl": "string", "message": "string"}

作者

  • Rafael Campos (@racampos)