cisco.dnac.cli_credential 模块 – 用于 CLI 凭证的资源模块

注意

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

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

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

要在 playbook 中使用它,请指定:cisco.dnac.cli_credential

cisco.dnac 3.1.0 中的新增功能

概要

  • 此模块表示模块 cli_credential_v1 的别名

注意

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

要求

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

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

comments

string

用于标识 CLI 凭证的注释。

credentialType

string

用于标识使用 CLI 凭证的应用程序的凭证类型。

description

string

CLI 凭证的描述。

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"

enablePassword

string

CLI 启用密码。

id

string

UUID 格式的 CLI 凭证的 ID。

instanceTenantId

string

已弃用。

instanceUuid

string

已弃用。

password

string

CLI 密码。

username

string

CLI 用户名。

validate_response_schema

boolean

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

选项

  • false

  • true ← (默认)

说明

注意

  • 使用的 SDK 方法是 discovery.Discovery.create_cli_credentials_v1, discovery.Discovery.update_cli_credentials_v1,

  • 使用的路径是 post /dna/intent/api/v1/global-credential/cli, put /dna/intent/api/v1/global-credential/cli,

  • 应注意,此模块是 cli_credential_v1 的别名

  • 不支持 check_mode

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

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

另请参阅

另请参阅

有关 Discovery CreateCLICredentialsV1 的 Cisco DNA Center 文档

CreateCLICredentialsV1 API 的完整参考。

有关 Discovery UpdateCLICredentialsV1 的 Cisco DNA Center 文档

UpdateCLICredentialsV1 API 的完整参考。

示例

- name: Update all
  cisco.dnac.cli_credential:
    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
    comments: string
    credentialType: string
    description: string
    enablePassword: string
    id: string
    instanceTenantId: string
    instanceUuid: string
    password: string
    username: string

- name: Create
  cisco.dnac.cli_credential:
    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
    comments: string
    credentialType: string
    description: string
    enablePassword: string
    id: string
    instanceTenantId: string
    instanceUuid: string
    password: string
    username: string

返回值

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

描述

dnac_response

dictionary

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

已返回: 始终

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

作者

  • Rafael Campos (@racampos)