cisco.catalystcenter.provision_intent module -- Resource module for provision functions

Note

This module is part of the cisco.catalystcenter collection (version 2.1.4).

To install it, use: ansible-galaxy collection install cisco.catalystcenter. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: cisco.catalystcenter.provision_intent.

New in cisco.catalystcenter 6.6.0

Synopsis

  • Manage operation related to wired and wireless provisioning

  • API to re-provision provisioned devices

  • API to un-provision provisioned devices

Requirements

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

  • catalystcentersdk >= 2.3.7.9

  • python >= 3.9

Parameters

Parameter

Comments

_api_port

string

The Cisco CATALYST Center port.

Default: :ansible-option-default:`"443"`

_debug

boolean

Flag for Cisco CATALYST Center SDK to enable debugging.

Choices:

_host

string / required

The Cisco CATALYST Center hostname.

_password

string

The Cisco CATALYST Center password to authenticate.

_username

aliases: user

string

The Cisco CATALYST Center username to authenticate.

Default: :ansible-option-default:`"admin"`

_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

_version

string

Informs the SDK which version of Cisco CATALYST Center to use.

Default: :ansible-option-default:`"2.2.3.3"`

catalystcenter_api_task_timeout

integer

Defines the timeout in seconds for API calls to retrieve task details. If the task details are not received within this period, the process will end, and a timeout notification will be logged.

Default: :ansible-option-default:`1200`

catalystcenter_task_poll_interval

integer

Specifies the interval in seconds between successive calls to the API to retrieve task details.

Default: :ansible-option-default:`2`

config

list / elements=dictionary / required

List of details of device being managed.

dynamic_interfaces

list / elements=dictionary

Interface details of the controller

interface_gateway

string

Ip Address allocated to the interface

interface_ip_address

string

Ip Address allocated to the interface

interface_name

string

Ip Address allocated to the interface

interface_netmask_in_c_i_d_r

integer

Ip Address allocated to the interface

lag_or_port_number

integer

Ip Address allocated to the interface

vlan_id

integer

Ip Address allocated to the interface

managed_ap_locations

list / elements=string

Location of the sites allocated for the APs

management_ip_address

string / required

Management Ip Address .

site_name

string

Name of site where the device needs to be added.

config_verify

boolean

Set to True to verify the Cisco Catalyst Center config after applying the playbook config.

Choices:

log

boolean

Flag to enable/disable playbook execution logging.

When true and log_file_path is provided, - Create the log file at the execution location with the specified name.

When true and log_file_path is not provided, - Create the log file at the execution location with the name 'catalystcenter.log'.

When false, - Logging is disabled.

If the log file doesn't exist, - It is created in append or write mode based on the "log_append" flag.

If the log file exists, - It is overwritten or appended based on the "log_append" flag.

Choices:

log_append

boolean

Determines the mode of the file. Set to True for 'append' mode. Set to False for 'write' mode.

Choices:

log_file_path

string

Governs logging. Logs are recorded if log is True.

If path is not specified, - When 'log_append' is True, 'catalystcenter.log' is generated in the current Ansible directory; logs are appended. - When 'log_append' is False, 'catalystcenter.log' is generated; logs are overwritten.

If path is specified, - When 'log_append' is True, the file opens in append mode. - When 'log_append' is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True.

Default: :ansible-option-default:`"catalystcenter.log"`

log_level

string

Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG].

CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages.

ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages.

WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages.

INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages.

DEBUG provides detailed diagnostic info. Displays all log messages.

Default: :ansible-option-default:`"WARNING"`

state

string

The state of DNAC after module completion.

Choices:

validate_response_schema

boolean

Flag for Cisco CATALYST Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

Notes

Note

  • SDK Methods used are sites.Sites.get_site, devices.Devices.get_network_device_by_ip, task.Task.get_task_by_id, sda.Sda.get_provisioned_wired_device, sda.Sda.re_provision_wired_device, sda.Sda.provision_wired_device, wireless.Wireless.provision

  • Paths used are get /dna/intent/api/v1/site get /dna/intent/api/v1/network-device/ip-address/{ipAddress} get /dna/intent/api/v1/task/{taskId} get /dna/intent/api/v1/business/sda/provision-device put /dna/intent/api/v1/business/sda/provision-device post /dna/intent/api/v1/business/sda/provision-device post /dna/intent/api/v1/wireless/provision

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco CATALYST SDK

  • The parameters starting with catalystCenter_ are used by the Cisco CATALYST Python SDK to establish the connection

Examples

- name: Create/Modify a new provision
  cisco.catalystcenter.provision_intent:
    _host: "{{ _host }}"
    _username: "{{ _username }}"
    _password: "{{ _password }}"
    _verify: "{{ _verify }}"
    _api_port: "{{ _api_port }}"
    _version: "{{ _version }}"
    _debug: "{{ _debug }}"
    log: true
    state: merged
    config:
      - site_name: string
        management_ip_address: string
        managed_ap_locations: list
        dynamic_interfaces:
          - vlan_id: integer
            interface_name: string
            interface_ip_address: string
            interface_gateway: string
            interface_netmask_in_c_i_d_r: integer
            lag_or_port_number: integer

Return Values

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

Key

Description

response_1

dictionary

response_2

list / elements=string

A list with the response returned by the Cisco DNAC Python SDK

Returned: always

Sample: :ansible-rv-sample-value:`["{\\n \\"response\\": []", "\\n \\"msg\\": String\\n}\\n"]`

response_3

dictionary

A dictionary with the exisiting details as returned by the Cisco DNAC Python SDK

Returned: always

Sample: :ansible-rv-sample-value:`"{\\n \\"response\\": String,\\n \\"msg\\": String\\n}\\n"`

Authors

  • Abinash Mishra (@abimishr)