cisco.dnac.device_configs_backup_workflow_manager module – Resource module for device_configs_backup functions

Note

This module is part of the cisco.dnac collection (version 6.16.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

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

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

New in cisco.dnac 6.14.0

Synopsis

  • Manage operation related to taking the backup of running config, static config and vlan.dat.bat

Requirements

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

  • dnacentersdk == 2.6.10

  • python >= 3.5

Parameters

Parameter

Comments

config

list / elements=dictionary / required

List of details regarding the device configuration backups being taken

Alteast one of the paramters mentioned in the suboptions must be passed in config

collection_status

string

Specifies the collection status of the device(s) on the GUI of Cisco Catalyst Center

family

string

Family of the device(s) as displayed on the inventory GUI of Cisco Catalyst Center

file_password

string

Optional file password for zipping and unzipping the config file.

Minimum password length is 8 and it should contain atleast one lower case letter, one uppercase letter, one digit and one special characters from -=\\\\\\\\;,./~!@$%^&*()_+{}[]|:?”

file_path

string

Location of the path or folder where the configs need to be exported in local system.

If the file_path is not provided, the backup file(s) will be stored in a directory named “tmp” in the same directory as the playbook.

Default: "tmp"

hostname

string

Hostname of the device as displayed on the inventory GUI of Cisco Catalyst Center

mac_address

string

Mac address of the device as displayed on the inventory GUI of Cisco Catalyst Center

management_ip_address

string

IP address of the device as displayed on the inventory GUI of Cisco Catalyst Center

serial_number

string

Serial number of the device as displayed on the inventory GUI of Cisco Catalyst Center

series

string

Specifies the series of the device(s) from the type, like Cisco Catalyst 9300 Series Switches

type

string

Specifies the type of the device(s) from the family, like Cisco Catalyst 9300 Switch or Cisco Catalyst 9500 Switch

config_verify

boolean

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

Choices:

  • false ← (default)

  • true

dnac_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: 1200

dnac_debug

boolean

Indicates whether debugging is enabled in the Cisco Catalyst Center SDK.

Choices:

  • false ← (default)

  • true

dnac_host

string / required

The hostname of the Cisco Catalyst Center.

dnac_log

boolean

Flag to enable/disable playbook execution logging.

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

When true and dnac_log_file_path is not provided, - Create the log file at the execution location with the name ‘dnac.log’.

When false, - Logging is disabled.

If the log file doesn’t exist, - It is created in append or write mode based on the “dnac_log_append” flag.

If the log file exists, - It is overwritten or appended based on the “dnac_log_append” flag.

Choices:

  • false ← (default)

  • true

dnac_log_append

boolean

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

Choices:

  • false

  • true ← (default)

dnac_log_file_path

string

Governs logging. Logs are recorded if dnac_log is True.

If path is not specified, - When ‘dnac_log_append’ is True, ‘dnac.log’ is generated in the current Ansible directory; logs are appended. - When ‘dnac_log_append’ is False, ‘dnac.log’ is generated; logs are overwritten.

If path is specified, - When ‘dnac_log_append’ is True, the file opens in append mode. - When ‘dnac_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: "dnac.log"

dnac_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: "WARNING"

dnac_password

string

The password for authentication at the Cisco Catalyst Center.

dnac_port

string

Specifies the port number associated with the Cisco Catalyst Center.

Default: "443"

dnac_task_poll_interval

integer

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

Default: 2

dnac_username

aliases: user

string

The username for authentication at the Cisco Catalyst Center.

Default: "admin"

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

  • false

  • true ← (default)

dnac_version

string

Specifies the version of the Cisco Catalyst Center that the SDK should use.

Default: "2.2.3.3"

state

string

The state of Cisco Catalyst Center after module completion.

Choices:

  • "merged" ← (default)

validate_response_schema

boolean

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

Choices:

  • false

  • true ← (default)

Notes

Note

  • SDK Methods used are devices.Devices.get_device_list, configuration_archive.ConfigurationsArchive.export_device_configurations, task.Task.get_task_by_id

  • Paths used are get /dna/intent/api/v1/network-device post dna/intent/api/v1/network-device-archive/cleartext get /dna/intent/api/v1/task/${taskId}

  • Does not support check_mode

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

  • The parameters starting with dnac_ are used by the Cisco Catalyst Center Python SDK to establish the connection

Examples

- name: Take backup of a 9300 wired device
  cisco.dnac.device_configs_backup_workflow_manager:
    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}}"
    dnac_log: True
    dnac_log_level: "{{dnac_log_level}}"
    state: merged
    config:
        - hostname: NY-BN-9500.cisco.local
          management_ip_address: 205.1.1.4
          serial_number: F2AKI0082J
          family: Switches and Hubs
          type: Cisco Catalyst 9300 Switch
          series: Cisco Catalyst 9300 Series Switches
          collection_status: Managed
          file_path: /home/admin/madhan_ansible/collections/ansible_collections/cisco/dnac/playbooks/new_tmp

Return Values

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

Key

Description

response_1

dictionary

A dictionary with with the response returned by the Cisco Catalyst Center Python SDK

Returned: always

Sample: "{\n  \"response\":\n    {\n      \"response\": String,\n      \"version\": String\n    },\n  \"msg\": String\n}\n"

response_2

list / elements=string

A string with the response returned by the Cisco Catalyst Center Python SDK

Returned: always

Sample: ["{\n  \"response\": []", "\n  \"msg\": String\n}\n"]

Authors

  • Abinash Mishra (@abimishr) Madhan Sankaranarayanan (@madhansansel)