cisco.dnac.template – Manage Template objects of ConfigurationTemplates

Note

This plugin is part of the cisco.dnac collection (version 2.0.7).

To install it use: ansible-galaxy collection install cisco.dnac.

To use it in a playbook, specify: cisco.dnac.template.

New in version 1.0.0: of cisco.dnac

Synopsis

  • Creates a new Template.

  • List the Templates available.

  • Updates an existing Template.

  • Returns details of the specified Template.

  • Deletes an existing Template.

Note

This module has a corresponding action plugin.

Requirements

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

  • dnacentersdk

Parameters

Parameter Choices/Defaults Comments
author
string
TemplateDTO's author.
composite
boolean
    Choices:
  • no
  • yes
TemplateDTO's composite.
containingTemplates
list / elements=dictionary
TemplateDTO's containingTemplates (list of objects).
composite
boolean
    Choices:
  • no
  • yes
It is the Template's composite.
id
string
It is the Template's id.
name
string
It is the Template's name.
version
string
It is the Template's version.
createTime
integer
TemplateDTO's createTime.
description
string
TemplateDTO's description.
deviceTypes
list / elements=dictionary
TemplateDTO's deviceTypes (list of objects).
productFamily
string
It is the Template's productFamily.
productSeries
string
It is the Template's productSeries.
productType
string
It is the Template's productType.
failurePolicy
string
TemplateDTO's failurePolicy.
filter_conflicting_templates
boolean
    Choices:
  • no
  • yes
FilterConflictingTemplates query parameter.
id
string
TemplateDTO's id.
lastUpdateTime
integer
TemplateDTO's lastUpdateTime.
latest_version
boolean
    Choices:
  • no
  • yes
LatestVersion query parameter.
name
string
TemplateDTO's name.
parentTemplateId
string
TemplateDTO's parentTemplateId.
product_family
string
ProductFamily query parameter.
product_series
string
ProductSeries query parameter.
product_type
string
ProductType query parameter.
project_id
string / required
ProjectId path parameter.
ProjectId query parameter.
Required for state create.
projectId
string
TemplateDTO's projectId.
projectName
string
TemplateDTO's projectName.
rollbackTemplateContent
string
TemplateDTO's rollbackTemplateContent.
rollbackTemplateParams
list / elements=dictionary
TemplateDTO's rollbackTemplateParams (list of objects).
binding
string
It is the Template's binding.
dataType
string
It is the Template's dataType.
defaultValue
string
It is the Template's defaultValue.
description
string
It is the Template's description.
displayName
string
It is the Template's displayName.
group
string
It is the Template's group.
id
string
It is the Template's id.
instructionText
string
It is the Template's instructionText.
key
string
It is the Template's key.
notParam
boolean
    Choices:
  • no
  • yes
It is the Template's notParam.
order
integer
It is the Template's order.
paramArray
boolean
    Choices:
  • no
  • yes
It is the Template's paramArray.
parameterName
string
It is the Template's parameterName.
provider
string
It is the Template's provider.
range
list / elements=dictionary
It is the Template's range.
id
string
It is the Template's id.
maxValue
integer
It is the Template's maxValue.
minValue
integer
It is the Template's minValue.
required
boolean
    Choices:
  • no
  • yes
It is the Template's required.
selection
dictionary
It is the Template's selection.
id
string
It is the Template's id.
selectionType
string
It is the Template's selectionType.
selectionValues
dictionary
It is the Template's selectionValues.
software_type
string
SoftwareType query parameter.
software_version
string
SoftwareVersion query parameter.
softwareType
string
TemplateDTO's softwareType.
softwareVariant
string
TemplateDTO's softwareVariant.
softwareVersion
string
TemplateDTO's softwareVersion.
tags
list / elements=string
TemplateDTO's tags (list of strings).
template_id
string / required
TemplateId path parameter.
templateContent
string
TemplateDTO's TemplateContent.
templateParams
list / elements=dictionary
TemplateDTO's TemplateParams (list of objects).
binding
string
It is the Template's binding.
dataType
string
It is the Template's dataType.
defaultValue
string
It is the Template's defaultValue.
description
string
It is the Template's description.
displayName
string
It is the Template's displayName.
group
string
It is the Template's group.
id
string
It is the Template's id.
instructionText
string
It is the Template's instructionText.
key
string
It is the Template's key.
notParam
boolean
    Choices:
  • no
  • yes
It is the Template's notParam.
order
integer
It is the Template's order.
paramArray
boolean
    Choices:
  • no
  • yes
It is the Template's paramArray.
parameterName
string
It is the Template's parameterName.
provider
string
It is the Template's provider.
range
list / elements=dictionary
It is the Template's range.
id
string
It is the Template's id.
maxValue
integer
It is the Template's maxValue.
minValue
integer
It is the Template's minValue.
required
boolean
    Choices:
  • no
  • yes
It is the Template's required.
selection
dictionary
It is the Template's selection.
id
string
It is the Template's id.
selectionType
string
It is the Template's selectionType.
selectionValues
dictionary
It is the Template's selectionValues.
version
string
TemplateDTO's version.

See Also

See also

cisco.dnac.plugins.module_utils.definitions.template

The official documentation on the cisco.dnac.plugins.module_utils.definitions.template module.

Template reference

Complete reference of the Template object model.

Template reference

SDK reference.

Examples

- name: create_template
  cisco.dnac.template:
    state: create  # required
    project_id: SomeValue  # string, required
    author: SomeValue  # string
    composite: True  # boolean
    containingTemplates:
    - composite: True  # boolean
      id: SomeValue  # string
      name: SomeValue  # string
      version: SomeValue  # string
    createTime: 1  #  integer
    description: SomeValue  # string
    deviceTypes:
    - productFamily: SomeValue  # string
      productSeries: SomeValue  # string
      productType: SomeValue  # string
    failurePolicy: # valid values are 'ABORT_ON_ERROR',
      # 'CONTINUE_ON_ERROR',
      # 'ROLLBACK_ON_ERROR',
      # 'ROLLBACK_TARGET_ON_ERROR',
      # 'ABORT_TARGET_ON_ERROR'.
      SomeValue  # string
    id: SomeValue  # string
    lastUpdateTime: 1  #  integer
    name: SomeValue  # string
    parentTemplateId: SomeValue  # string
    projectId: SomeValue  # string
    projectName: SomeValue  # string
    rollbackTemplateContent: SomeValue  # string
    rollbackTemplateParams:
    - binding: SomeValue  # string
      dataType: SomeValue  # string
      defaultValue: SomeValue  # string
      description: SomeValue  # string
      displayName: SomeValue  # string
      group: SomeValue  # string
      id: SomeValue  # string
      instructionText: SomeValue  # string
      key: SomeValue  # string
      notParam: True  # boolean
      order: 1  #  integer
      paramArray: True  # boolean
      parameterName: SomeValue  # string
      provider: SomeValue  # string
      range:
      - id: SomeValue  # string
        maxValue: 1  #  integer
        minValue: 1  #  integer
      required: True  # boolean
      selection:
        id: SomeValue  # string
        selectionType: SomeValue  # string
        selectionValues:
    softwareType: SomeValue  # string
    softwareVariant: SomeValue  # string
    softwareVersion: SomeValue  # string
    tags:
    - SomeValue  # string
    templateContent: SomeValue  # string
    templateParams:
    - binding: SomeValue  # string
      dataType: SomeValue  # string
      defaultValue: SomeValue  # string
      description: SomeValue  # string
      displayName: SomeValue  # string
      group: SomeValue  # string
      id: SomeValue  # string
      instructionText: SomeValue  # string
      key: SomeValue  # string
      notParam: True  # boolean
      order: 1  #  integer
      paramArray: True  # boolean
      parameterName: SomeValue  # string
      provider: SomeValue  # string
      range:
      - id: SomeValue  # string
        maxValue: 1  #  integer
        minValue: 1  #  integer
      required: True  # boolean
      selection:
        id: SomeValue  # string
        selectionType: SomeValue  # string
        selectionValues:
    version: SomeValue  # string

- name: gets_the_templates_available
  cisco.dnac.template:
    state: query  # required
    filter_conflicting_templates: True  # boolean
    product_family: SomeValue  # string
    product_series: SomeValue  # string
    product_type: SomeValue  # string
    project_id: SomeValue  # string
    software_type: SomeValue  # string
    software_version: SomeValue  # string
  register: nm_gets_the_templates_available

- name: update_template
  cisco.dnac.template:
    state: update  # required
    author: SomeValue  # string
    composite: True  # boolean
    containingTemplates:
    - composite: True  # boolean
      id: SomeValue  # string
      name: SomeValue  # string
      version: SomeValue  # string
    createTime: 1  #  integer
    description: SomeValue  # string
    deviceTypes:
    - productFamily: SomeValue  # string
      productSeries: SomeValue  # string
      productType: SomeValue  # string
    failurePolicy: # valid values are 'ABORT_ON_ERROR',
      # 'CONTINUE_ON_ERROR',
      # 'ROLLBACK_ON_ERROR',
      # 'ROLLBACK_TARGET_ON_ERROR',
      # 'ABORT_TARGET_ON_ERROR'.
      SomeValue  # string
    id: SomeValue  # string
    lastUpdateTime: 1  #  integer
    name: SomeValue  # string
    parentTemplateId: SomeValue  # string
    projectId: SomeValue  # string
    projectName: SomeValue  # string
    rollbackTemplateContent: SomeValue  # string
    rollbackTemplateParams:
    - binding: SomeValue  # string
      dataType: SomeValue  # string
      defaultValue: SomeValue  # string
      description: SomeValue  # string
      displayName: SomeValue  # string
      group: SomeValue  # string
      id: SomeValue  # string
      instructionText: SomeValue  # string
      key: SomeValue  # string
      notParam: True  # boolean
      order: 1  #  integer
      paramArray: True  # boolean
      parameterName: SomeValue  # string
      provider: SomeValue  # string
      range:
      - id: SomeValue  # string
        maxValue: 1  #  integer
        minValue: 1  #  integer
      required: True  # boolean
      selection:
        id: SomeValue  # string
        selectionType: SomeValue  # string
        selectionValues:
    softwareType: SomeValue  # string
    softwareVariant: SomeValue  # string
    softwareVersion: SomeValue  # string
    tags:
    - SomeValue  # string
    templateContent: SomeValue  # string
    templateParams:
    - binding: SomeValue  # string
      dataType: SomeValue  # string
      defaultValue: SomeValue  # string
      description: SomeValue  # string
      displayName: SomeValue  # string
      group: SomeValue  # string
      id: SomeValue  # string
      instructionText: SomeValue  # string
      key: SomeValue  # string
      notParam: True  # boolean
      order: 1  #  integer
      paramArray: True  # boolean
      parameterName: SomeValue  # string
      provider: SomeValue  # string
      range:
      - id: SomeValue  # string
        maxValue: 1  #  integer
        minValue: 1  #  integer
      required: True  # boolean
      selection:
        id: SomeValue  # string
        selectionType: SomeValue  # string
        selectionValues:
    version: SomeValue  # string

- name: get_template_details
  cisco.dnac.template:
    state: query  # required
    template_id: SomeValue  # string, required
    latest_version: True  # boolean
  register: nm_get_template_details

- name: delete_template
  cisco.dnac.template:
    state: delete  # required
    template_id: SomeValue  # string, required

Return Values

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

Key Returned Description
dnac_response
dictionary
always
A dictionary with the response returned by the DNA Center Python SDK

Sample:
{'response': 29, 'version': '1.0'}
missing_params
list / elements=string
when the function request schema is not satisfied
Provided arguments do not comply with the schema of the DNA Center Python SDK function

sdk_function
string
always
The DNA Center SDK function used to execute the task

Sample:
configuration_templates.create_template


Authors

  • Rafael Campos (@racampos)