cisco.dnac.backup_and_restore_playbook_config_generator module -- Generate YAML playbook for 'backup_and_restore_workflow_manager' module.

Note

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

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.backup_and_restore_playbook_config_generator.

New in cisco.dnac 6.44.0

Synopsis

  • Generates YAML configurations compatible with the backup_and_restore_workflow_manager module, reducing manual playbook creation effort and enabling programmatic modifications.

  • Represents NFS server configurations and backup storage configurations for backup and restore operations on Cisco Catalyst Center.

  • Supports extraction of NFS configurations, backup storage configurations with encryption and retention policies.

  • Generated YAML format is directly usable with backup_and_restore_workflow_manager module for infrastructure as code.

Requirements

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

  • dnacentersdk >= 2.9.3

  • python >= 3.9

Parameters

Parameter

Comments

config

dictionary

A dictionary of filters for generating YAML playbook compatible with the 'backup_and_restore_workflow_manager' module.

Filters specify which components to include in the YAML configuration file.

If components_list is specified, only those components are included, regardless of the filters.

component_specific_filters is mandatory.

component_specific_filters

dictionary / required

Required when config is provided.

Filters to specify which components to include in the YAML configuration file.

If components_list is specified, only those components are included, regardless of other filters.

If component filter blocks are provided (for example nfs_configuration), those components are automatically added to components_list when missing.

If no component filter blocks are provided, components_list is mandatory and must not be empty.

backup_storage_configuration

list / elements=dictionary

Backup storage configuration filtering options by server type only.

If not specified, all backup storage configurations are included.

Only server_type filtering is supported for backup storage.

Other filter parameters like mount_path or retention_period are not supported.

server_type

string

Server type for filtering backup configurations.

NFS type represents network-based backup storage.

PHYSICAL_DISK type represents local disk backup storage.

Choices:

components_list

list / elements=string

List of components to include in the YAML configuration file.

Valid values are - NFS Configuration "nfs_configuration" - Backup Storage Configuration "backup_storage_configuration"

Required when no component-specific filter blocks are provided.

Empty list is invalid when no component-specific filter blocks are provided.

Supports multiple filter entries for filtering multiple NFS servers.

Choices:

nfs_configuration

list / elements=dictionary

NFS configuration details to filter NFS servers.

Both server_ip and source_path must be provided together for filtering.

If not specified, all NFS configurations are included.

server_ip

string

Server IP address of the NFS server.

Must be provided along with source_path for filtering.

Used for exact match filtering of NFS configurations.

source_path

string

Source path on the NFS server.

Must be provided along with server_ip for filtering.

Used for exact match filtering of NFS configurations.

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: :ansible-option-default:`1200`

dnac_debug

boolean

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

Choices:

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:

dnac_log_append

boolean

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

Choices:

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: :ansible-option-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: :ansible-option-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: :ansible-option-default:`"443"`

dnac_task_poll_interval

integer

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

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

dnac_username

aliases: user

string

The username for authentication at the Cisco Catalyst Center.

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

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

dnac_version

string

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

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

file_mode

string

File write mode for the generated YAML configuration file.

The overwrite option replaces existing file content with new content.

The append option adds new content to the end of existing file.

Defaults to overwrite if not specified.

file_mode is only applicable when file_path is provided.

Choices:

file_path

string

Path where the YAML configuration file will be saved.

If not provided, the file will be saved in the current working directory with a default file name backup_and_restore_playbook_config_<YYYY-MM-DD_HH-MM-SS>.yml.

For example, backup_and_restore_playbook_config_2026-01-27_14-21-41.yml.

Supports both absolute and relative paths.

state

string

Desired state of Cisco Catalyst Center after module execution.

Only gathered state is supported for extracting configurations.

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 - backup.Backup.get_all_n_f_s_configurations - backup.Backup.get_backup_configuration

  • Paths used are - GET /dna/system/api/v1/backupNfsConfigurations - GET /dna/system/api/v1/backupConfiguration

  • Requires Cisco Catalyst Center version 3.1.3.0 or higher

  • Only supports gathered state for extracting existing configurations

  • NFS filtering requires both server_ip and source_path together

  • Backup storage filtering only supports server_type parameter

  • Generated YAML file format is compatible with backup_and_restore_workflow_manager module

  • File path supports both absolute and relative paths

  • Default filename includes timestamp for uniqueness

  • NFS details correlation matches backup mount paths with NFS destination paths automatically

  • Empty configurations return success with idempotent behavior

  • Module does not modify Catalyst Center configuration

  • 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

See Also

See also

cisco.dnac.backup_and_restore_workflow_manager

Module to manage backup and restore NFS configurations in Cisco Catalyst Center.

Examples

- name: Generate YAML Configuration with both NFS and backup storage configurations
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_backup_restore_config.yaml"
    config:
      component_specific_filters:
        components_list:
          - "nfs_configuration"
          - "backup_storage_configuration"

- name: Generate YAML for NFS-type backup storage only filtering by server_type
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_backup_storage_config.yaml"
    file_mode: "overwrite"
    config:
      component_specific_filters:
        components_list: ["backup_storage_configuration"]
        backup_storage_configuration:
          - server_type: "NFS"

- name: Generate YAML for specific NFS server using exact match on server_ip and source_path
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_specific_nfs_config.yaml"
    config:
      component_specific_filters:
        components_list: ["nfs_configuration"]
        nfs_configuration:
          - server_ip: "172.27.17.90"
            source_path: "/home/nfsshare/backups/TB30"

- name: Generate YAML for all configurations without filtering useful for complete system documentation
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_backup_restore_config.yaml"
    config:
      component_specific_filters:
        components_list:
          - "nfs_configuration"
          - "backup_storage_configuration"

- name: Append YAML Configuration for multiple NFS servers to existing file
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_multiple_nfs_config.yaml"
    file_mode: "append"
    config:
      component_specific_filters:
        components_list: ["nfs_configuration"]
        nfs_configuration:
          - server_ip: "172.27.17.90"
            source_path: "/home/nfsshare/backups/TB30"
          - server_ip: "172.27.17.91"
            source_path: "/home/nfsshare/backups/TB31"

- name: Generate YAML Configuration for Physical Disk backup storage only
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_physical_disk_backup.yaml"
    config:
      component_specific_filters:
        components_list: ["backup_storage_configuration"]
        backup_storage_configuration:
          - server_type: "NFS"

- name: Component filter auto-adds missing component to components_list
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_component_auto_add.yaml"
    config:
      component_specific_filters:
        components_list: ["nfs_configuration"]
        backup_storage_configuration:
          - server_type: "NFS"

- name: Equivalent explicit components_list for same filter behavior
  cisco.dnac.backup_and_restore_playbook_config_generator:
    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: gathered
    file_path: "/tmp/catc_component_explicit.yaml"
    config:
      component_specific_filters:
        components_list: ["nfs_configuration", "backup_storage_configuration"]
        backup_storage_configuration:
          - server_type: "NFS"

Return Values

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

Key

Description

response_1

dictionary

Response from YAML configuration generation operation with execution statistics and status information.

Returned: always

msg

string

response

dictionary

Detailed operation results and statistics

Returned: always

components_processed

integer

Number of components successfully retrieved

Returned: always

Sample: :ansible-rv-sample-value:`2`

components_skipped

integer

Number of components skipped due to errors or no data available

Returned: always

Sample: :ansible-rv-sample-value:`0`

configurations_count

integer

Total configuration items across all components

Returned: always

Sample: :ansible-rv-sample-value:`5`

file_path

string

Absolute path to generated YAML file

Returned: on_success

Sample: :ansible-rv-sample-value:`"/tmp/backup\_restore\_config.yaml"`

message

string

status

string

Operation status indicating success or failure

Returned: always

Can only return:

status

string

Overall operation status

Returned: always

Can only return:

response_2

dictionary

response_3

dictionary

Authors

  • Priyadharshini B (@pbalaku2)

  • Madhan Sankaranarayanan (@madhansansel)