cisco.dnac.configuration_template 模块 – 配置模板的资源模块

注意

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

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

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

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

cisco.dnac 3.1.0 中的新功能

概要

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

注意

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

要求

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

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

author

字符串

模板的作者。

composite

布尔值

它是复合模板吗。

选择

  • false

  • true

containingTemplates

列表 / 元素=字典

配置模板的 containingTemplates。

composite

布尔值

它是复合模板吗。

选择

  • false

  • true

description

字符串

模板的描述。

deviceTypes

列表 / 元素=字典

配置模板的 deviceTypes。

productFamily

字符串

设备系列。

productSeries

字符串

设备系列。

productType

字符串

设备类型。

id

字符串

模板的 UUID。

language

字符串

模板语言(JINJA 或 VELOCITY)。

name

字符串

模板的名称。

projectName

字符串

项目名称。

rollbackTemplateParams

列表 / 元素=字典

配置模板的 rollbackTemplateParams。

binding

字符串

绑定到源。

customOrder

整数

模板参数的 CustomOrder。

dataType

字符串

模板参数的数据类型。

defaultValue

字符串

模板参数的默认值。

description

字符串

模板参数的描述。

displayName

字符串

参数的显示名称。

group

字符串

组。

id

字符串

模板参数的 UUID。

instructionText

字符串

参数的说明文本。

key

字符串

键。

notParam

布尔值

它不是变量。

选择

  • false

  • true

order

整数

模板参数的顺序。

paramArray

布尔值

它是一个数组。

选择

  • false

  • true

parameterName

字符串

模板参数的名称。

provider

字符串

提供程序。

range

列表 / 元素=字典

配置模板的范围。

id

字符串

范围的 UUID。

maxValue

整数

范围的最大值。

minValue

整数

范围的最小值。

required

布尔值

参数是否必需。

选择

  • false

  • true

selection

字典

配置模板的选择。

defaultSelectedValues

列表 / 元素=字符串

默认选择值。

id

字符串

选择的 UUID。

selectionType

字符串

选择的类型(SINGLE_SELECT 或 MULTI_SELECT)。

selectionValues

字典

选择值。

tags

列表 / 元素=字典

配置模板的标签。

id

字符串

标签的 UUID。

name

字符串

标签的名称。

templateContent

字符串

模板内容。

templateParams

列表 / 元素=字典

配置模板的 templateParams。

binding

字符串

绑定到源。

customOrder

整数

模板参数的 CustomOrder。

dataType

字符串

模板参数的数据类型。

defaultValue

字符串

模板参数的默认值。

description

字符串

模板参数的描述。

displayName

字符串

参数的显示名称。

group

字符串

组。

id

字符串

模板参数的 UUID。

instructionText

字符串

参数的说明文本。

key

字符串

键。

notParam

布尔值

它不是变量。

选择

  • false

  • true

order

整数

模板参数的顺序。

paramArray

布尔值

它是一个数组。

选择

  • false

  • true

parameterName

字符串

模板参数的名称。

provider

字符串

提供程序。

range

列表 / 元素=字典

配置模板的范围。

id

字符串

范围的 UUID。

maxValue

整数

范围的最大值。

minValue

整数

范围的最小值。

required

布尔值

参数是否必需。

选择

  • false

  • true

selection

字典

配置模板的选择。

defaultSelectedValues

列表 / 元素=字符串

默认选择值。

id

字符串

选择的 UUID。

selectionType

字符串

选择的类型(SINGLE_SELECT 或 MULTI_SELECT)。

selectionValues

字典

选择值。

version

字符串

模板的当前版本。

createTime

整数

模板的创建时间。

customParamsOrder

布尔值

自定义参数顺序。

选择

  • false

  • true

description

字符串

模板的描述。

deviceTypes

列表 / 元素=字典

配置模板的 deviceTypes。

productFamily

字符串

设备系列。

productSeries

字符串

设备系列。

productType

字符串

设备类型。

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"

failurePolicy

字符串

定义模板配置失败时的失败策略。

id

字符串

模板的 UUID。

language

字符串

模板语言(JINJA 或 VELOCITY)。

lastUpdateTime

整数

模板的更新时间。

latestVersionTime

整数

最新版本的模板时间。

name

字符串

模板的名称。

parentTemplateId

字符串

父模板 ID。

projectId

字符串

项目 UUID。

projectName

字符串

项目名称。

rollbackTemplateContent

字符串

回滚模板内容。

rollbackTemplateParams

列表 / 元素=字典

配置模板的 rollbackTemplateParams。

binding

字符串

绑定到源。

customOrder

整数

模板参数的 CustomOrder。

dataType

字符串

模板参数的数据类型。

defaultValue

字符串

模板参数的默认值。

description

字符串

模板参数的描述。

displayName

字符串

参数的显示名称。

group

字符串

组。

id

字符串

模板参数的 UUID。

instructionText

字符串

参数的说明文本。

key

字符串

键。

notParam

布尔值

它不是变量。

选择

  • false

  • true

order

整数

模板参数的顺序。

paramArray

布尔值

它是一个数组。

选择

  • false

  • true

parameterName

字符串

模板参数的名称。

provider

字符串

提供程序。

range

列表 / 元素=字典

配置模板的范围。

id

字符串

范围的 UUID。

maxValue

整数

范围的最大值。

minValue

整数

范围的最小值。

required

布尔值

参数是否必需。

选择

  • false

  • true

selection

字典

配置模板的选择。

defaultSelectedValues

列表 / 元素=字符串

默认选择值。

id

字符串

选择的 UUID。

selectionType

字符串

选择的类型(SINGLE_SELECT 或 MULTI_SELECT)。

selectionValues

字典

选择值。

softwareType

字符串

适用的设备软件类型。

softwareVariant

字符串

适用的设备软件变体。

softwareVersion

字符串

适用的设备软件版本。

tags

列表 / 元素=字典

配置模板的标签。

id

字符串

标签的 UUID。

name

字符串

标签的名称。

templateContent

字符串

模板内容。

templateId

字符串

TemplateId 路径参数。要删除的模板的 TemplateId(UUID)。

templateParams

列表 / 元素=字典

配置模板的 templateParams。

binding

字符串

绑定到源。

customOrder

整数

模板参数的 CustomOrder。

dataType

字符串

模板参数的数据类型。

defaultValue

字符串

模板参数的默认值。

description

字符串

模板参数的描述。

displayName

字符串

参数的显示名称。

group

字符串

组。

id

字符串

模板参数的 UUID。

instructionText

字符串

参数的说明文本。

key

字符串

键。

notParam

布尔值

它不是变量。

选择

  • false

  • true

order

整数

模板参数的顺序。

paramArray

布尔值

它是一个数组。

选择

  • false

  • true

parameterName

字符串

模板参数的名称。

provider

字符串

提供程序。

range

列表 / 元素=字典

配置模板的范围。

id

字符串

范围的 UUID。

maxValue

整数

范围的最大值。

minValue

整数

范围的最小值。

required

布尔值

参数是否必需。

选择

  • false

  • true

selection

字典

配置模板的选择。

defaultSelectedValues

列表 / 元素=字符串

默认选择值。

id

字符串

选择的 UUID。

selectionType

字符串

选择的类型(SINGLE_SELECT 或 MULTI_SELECT)。

selectionValues

字典

选择值。

validate_response_schema

布尔值

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

选择

  • false

  • true ←(默认)

validationErrors

字典

配置模板的 validationErrors。

rollbackTemplateErrors

字典

回滚模板的验证或设计冲突错误。

templateErrors

字典

验证或设计冲突错误。

templateId

字符串

模板的 UUID。

templateVersion

字符串

模板的当前版本。

version

字符串

模板的当前版本。

注释

注意

  • 使用的 SDK 方法是 configuration_templates.ConfigurationTemplates.deletes_the_template_v1,configuration_templates.ConfigurationTemplates.update_template_v1,

  • 使用的路径是 delete /dna/intent/api/v1/template-programmer/template/{templateId},put /dna/intent/api/v1/template-programmer/template,

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

  • 不支持 check_mode

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

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

另请参阅

另请参阅

Cisco DNA Center 关于配置模板 DeletesTheTemplateV1 的文档

DeletesTheTemplateV1 API 的完整参考。

Cisco DNA Center 关于配置模板 UpdateTemplateV1 的文档

UpdateTemplateV1 API 的完整参考。

示例

- name: Update all
  cisco.dnac.configuration_template:
    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
    author: string
    composite: true
    containingTemplates:
    - composite: true
      description: string
      deviceTypes:
      - productFamily: string
        productSeries: string
        productType: string
      id: string
      language: string
      name: string
      projectName: string
      rollbackTemplateParams:
      - binding: string
        customOrder: 0
        dataType: string
        defaultValue: string
        description: string
        displayName: string
        group: string
        id: string
        instructionText: string
        key: string
        notParam: true
        order: 0
        paramArray: true
        parameterName: string
        provider: string
        range:
        - id: string
          maxValue: 0
          minValue: 0
        required: true
        selection:
          defaultSelectedValues:
          - string
          id: string
          selectionType: string
          selectionValues: {}
      tags:
      - id: string
        name: string
      templateContent: string
      templateParams:
      - binding: string
        customOrder: 0
        dataType: string
        defaultValue: string
        description: string
        displayName: string
        group: string
        id: string
        instructionText: string
        key: string
        notParam: true
        order: 0
        paramArray: true
        parameterName: string
        provider: string
        range:
        - id: string
          maxValue: 0
          minValue: 0
        required: true
        selection:
          defaultSelectedValues:
          - string
          id: string
          selectionType: string
          selectionValues: {}
      version: string
    createTime: 0
    customParamsOrder: true
    description: string
    deviceTypes:
    - productFamily: string
      productSeries: string
      productType: string
    failurePolicy: string
    id: string
    language: string
    lastUpdateTime: 0
    latestVersionTime: 0
    name: string
    parentTemplateId: string
    projectId: string
    projectName: string
    rollbackTemplateContent: string
    rollbackTemplateParams:
    - binding: string
      customOrder: 0
      dataType: string
      defaultValue: string
      description: string
      displayName: string
      group: string
      id: string
      instructionText: string
      key: string
      notParam: true
      order: 0
      paramArray: true
      parameterName: string
      provider: string
      range:
      - id: string
        maxValue: 0
        minValue: 0
      required: true
      selection:
        defaultSelectedValues:
        - string
        id: string
        selectionType: string
        selectionValues: {}
    softwareType: string
    softwareVariant: string
    softwareVersion: string
    tags:
    - id: string
      name: string
    templateContent: string
    templateParams:
    - binding: string
      customOrder: 0
      dataType: string
      defaultValue: string
      description: string
      displayName: string
      group: string
      id: string
      instructionText: string
      key: string
      notParam: true
      order: 0
      paramArray: true
      parameterName: string
      provider: string
      range:
      - id: string
        maxValue: 0
        minValue: 0
      required: true
      selection:
        defaultSelectedValues:
        - string
        id: string
        selectionType: string
        selectionValues: {}
    validationErrors:
      rollbackTemplateErrors: {}
      templateErrors: {}
      templateId: string
      templateVersion: string
    version: string

- name: Delete by id
  cisco.dnac.configuration_template:
    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
    templateId: string

返回值

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

描述

dnac_response

字典

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

返回: 总是

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

作者

  • Rafael Campos (@racampos)