cisco.dnac.backup_and_restore_workflow_manager module – Resource module for comprehensive backup and restore workflow management with NFS server configuration in Cisco Catalyst Center.

Note

This module is part of the cisco.dnac collection (version 6.42.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.backup_and_restore_workflow_manager.

New in cisco.dnac 6.31.0

Synopsis

  • Automates comprehensive backup and restore workflow management in Cisco Catalyst Center including NFS server configuration, backup target setup, create backup, and restoration operations.

  • Enables NFS server configuration for secure backup storage with customizable port settings, protocol versions, and source path management.

  • Supports backup configuration with encryption, retention policies, and server type specification for enterprise data protection.

  • Facilitates backup restoration with encryption passphrase validation for secure data recovery operations.

  • Supports deletion operations for NFS configurations and backup to maintain clean backup infrastructure.

  • Integrates with Cisco Catalyst Center’s backup framework for centralized network infrastructure data protection and disaster recovery.

Requirements

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

  • dnacentersdk >= 2.9.3

  • python >= 3.9.19

Parameters

Parameter

Comments

config

list / elements=dictionary / required

List of comprehensive backup and restore configuration specifications including NFS server setup, backup target configuration, creating backup parameters, and restoration details.

Each configuration supports NFS server management, backup policy definition, backup creation, and restore operation parameters for enterprise backup infrastructure automation.

backup

list / elements=dictionary

Configuration for creating and executing backup jobs.

Creates backup jobs with specified name and data scope.

This CREATES and EXECUTES backup immediately (not scheduling).

Requires backup storage configuration to be set up first.

backup_retention_days

integer

Duration-based backup retention policy for automated cleanup operations.

Retains backups created within the specified number of days and deletes older backups.

When used with name parameter, applies retention policy only to backups matching the name prefix.

When used alone, applies retention policy to all backups in the system.

Must be a positive integer representing number of days (e.g., 7 for one week, 30 for one month).

Only valid when state=deleted is specified.

Example backup_retention_days=7 with name=”DAILY_BACKUP” retains backups with “DAILY_BACKUP” prefix created in last 7 days, deletes older ones.

Example backup_retention_days=30 without name parameter retains all backups created in last 30 days, deletes all older backups regardless of name.

Ignored when delete_all_backup=true is specified.

delete_all_backup

boolean

Set to true to delete all existing backups from Cisco Catalyst Center.

Only valid when state=deleted is specified.

When enabled, removes all backup regardless of name or creation date.

Use with extreme caution as this operation is irreversible and will permanently remove all backup data.

Takes precedence over individual backup name deletion when both are specified.

Useful for complete backup infrastructure cleanup or maintenance operations.

Choices:

  • false ← (default)

  • true

generate_new_backup

boolean

Controls backup naming strategy and creation behavior.

When true, always creates new backup using name as prefix with timestamp suffix.

When false or not specified, uses exact name and follows idempotent behavior.

Only applicable when state=merged for backup creation operations.

Ignored during deletion operations (state=deleted).

Timestamp format is “YYYYMMDD_HHMMSS” using Indian Standard Time (IST).

Useful for automated backup schedules where unique names are required.

Choices:

  • false ← (default)

  • true

name

string

Name parameter for backup identification and management operations.

Serves dual purpose based on operation context and additional parameters.

For backup creation (state=merged), when generate_new_backup=false or not specified, creates backup with this exact name.

Follows standard Ansible idempotency - if backup exists with same name, no new backup is created.

When generate_new_backup=true, uses this name as prefix and appends timestamp.

Timestamp format is “YYYYMMDD_HHMMSS” using Indian Standard Time (IST) (e.g., 20241230_143052).

Example with generate_new_backup=true and name=”DAILY_BACKUP” creates “DAILY_BACKUP_20241230_143052”.

For backup deletion (state=deleted), when used alone, deletes backup with this exact name.

When used with backup_retention_days, treats this as prefix to filter backups by name and retention period.

Example with name=”DAILY_BACKUP” and backup_retention_days=7 deletes all backups starting with “DAILY_BACKUP” created more than 7 days ago.

Backup name must begin with an alphabet and can contain letters, digits, and the following special characters @, _, -, space, and

scope

string

Defines backup scope including assurance data specifications.

Determines what data types are included in backup operations.

Choices:

  • "CISCO_DNA_DATA_WITH_ASSURANCE"

  • "CISCO_DNA_DATA_WITHOUT_ASSURANCE"

backup_storage_configuration

list / elements=dictionary

Configuration for backup storage infrastructure and data management policies.

Sets up NFS storage targets, encryption, and data retention settings.

This configures WHERE and HOW backup data will be stored.

Does not create or execute backup, only prepares storage infrastructure.

data_retention_period

integer / required

Number of days to retain backup before cleanup.

Range must be between 3 and 60 days.

encryption_passphrase

string

Passphrase for encrypting backup data during storage operations.

Strongly recommended for secure data protection and compliance.

nfs_details

dictionary

Connection details for NFS backup targets including server information and storage path specifications.

Used to retrieve mount path for backup storage operations.

nfs_port

integer

Port number used to access NFS services.

nfs_portmapper_port

integer

Port number for the NFS portmapper service.

Default: 111

nfs_version

string

NFS protocol version for backup communication.

Choices:

  • "nfs3"

  • "nfs4" ← (default)

server_ip

string / required

IP address of the NFS server for backup operations.

source_path

string / required

Directory path on the NFS server for backup storage.

server_type

string / required

Type of backup storage server for data preservation.

Only NFS storage type is supported in Catalyst Center version 3.1.3.0.

PHYSICAL_DISK type is not supported in Catalyst Center version 3.1.3.0.

Choices:

  • "NFS"

  • "PHYSICAL_DISK"

nfs_configuration

list / elements=dictionary

Configuration details for NFS backup server setup and management.

Defines NFS server connection parameters including IP address, source paths, port configurations, and protocol version settings for secure backup storage infrastructure.

nfs_port

integer

Port number used for NFS service communication and data transfer operations.

Must be accessible and not blocked by firewalls between Catalyst Center and NFS server.

Default: 2049

nfs_portmapper_port

integer

Port number for the NFS portmapper service on target server.

Used for dynamic port allocation and service discovery.

Default: 111

nfs_version

string

NFS protocol version for backup storage communication.

Determines compatibility and security features available for backup operations.

Choices:

  • "nfs3"

  • "nfs4" ← (default)

server_ip

string / required

IP address of the NFS server for backup storage connectivity.

Must be a valid IPv4 address accessible from Cisco Catalyst Center for backup operations.

source_path

string / required

Directory path on the NFS server designated for storing backup files and data.

Path must exist on the NFS server and have appropriate permissions for backup operations.

restore_operations

list / elements=dictionary

Parameters for restoring data from previously created backups including authentication and validation requirements.

encryption_passphrase

string

Passphrase for decrypting backup data during restore operations.

Must match the passphrase used during backup creation.

name

string / required

Name of the backup to restore from available backup list.

config_verify

boolean

Set to True to verify the Cisco Catalyst Center after applying changes.

Choices:

  • false

  • true ← (default)

dnac_api_task_timeout

integer

Time in seconds to wait for API tasks to complete before timing out.

For backup operations (creation/deletion), default timeout of 1200 seconds is typically sufficient.

For restore operations, use a significantly higher value (minimum 3600 seconds or above) as restore processes can take substantially longer depending on backup size and system load.

If timeout is reached, the operation may still be running on Catalyst Center backend.

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

Specifies the desired operational state for backup and restore configuration management.

Use merged to create new backup configurations or update existing NFS settings, backups, and restoration parameters.

Use deleted to remove NFS configurations, backups, or cleanup backup infrastructure components based on configuration provided.

Supports selective deletion for backup lifecycle management and infrastructure cleanup operations.

Choices:

  • "merged" ← (default)

  • "deleted"

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

  • Backup and restore functionality is available in Cisco Catalyst Center version 3.1.3.0 and later for comprehensive data protection workflow

  • NFS server configuration must be completed and healthy before backup target configuration to ensure proper mount path availability

  • Backup and restore functionality requires encryption passphrases for secure data protection. Never hardcode these values in playbooks.

  • Use Ansible Vault to encrypt sensitive backup configuration parameters including encryption passphrases and NFS server credentials.

  • Store backup encryption passphrases in separate encrypted variable files (e.g., backup_secrets.yml) and decrypt during playbook execution.

  • Consider using environment variables for backup credentials in CI/CD pipelines to avoid exposing sensitive data in version control.

  • The same encryption passphrase used during backup creation must be provided during restore operations for successful data recovery.

  • Encryption passphrases are automatically masked in logs when using no_log parameter specifications in the module documentation.

  • Encryption passphrases used during backup creation must be identical to those provided during restore operations for successful data recovery

  • Data retention periods are enforced automatically with cleanup occurring after the specified retention period expires (3-60 days)

  • Backup and restore operations are asynchronous with task monitoring to track completion status and provide operational feedback

  • NFS configurations require proper network connectivity and permissions between Catalyst Center and the target NFS server infrastructure

  • Only NFS storage type is supported for backup targets in version 3.1.3.0 with additional storage types planned for future releases.

  • SDK Methods used are - backup.Backup.get_backup_and_restore_execution - backup.Backup.get_backup_by_id - backup.Backup.get_backup_and_restore_executions - backup.Backup.get_backup_configuration - backup.Backup.create_n_f_s_configuration - backup.Backup.get_all_backup - backup.Backup.delete_n_f_s_configuration - backup.Backup.create_backup - backup.Backup.delete_backup - backup.Backup.get_backup_storages - backup.Backup.get_all_n_f_s_configurations - backup.Backup.create_backup_configuration - restore.Restore.restore_backup

  • Paths used are - GET/dna/system/api/v1/backupRestoreExecutions/${id} - GET/dna/system/api/v1/backups/${id} - GET/dna/system/api/v1/backupRestoreExecutions - GET/dna/system/api/v1/backupConfiguration - POST/dna/system/api/v1/backupNfsConfigurations - GET/dna/system/api/v1/backups - DELETE/dna/system/api/v1/backupNfsConfigurations/${id} - POST/dna/system/api/v1/backups - DELETE/dna/system/api/v1/backups/${id} - GET/dna/system/api/v1/backupStorages - GET/dna/system/api/v1/backupNfsConfigurations - POST/dna/system/api/v1/backupConfiguration - POST/dna/system/api/v1/backups/${id}/restore

  • 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

# Example 1: Configure NFS server for backup storage infrastructure
- name: Configure NFS backup server for enterprise data protection
  hosts: localhost
  vars_files:
    - "credentials.yml"
    - "backup_secrets.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Configure NFS server for secure backup storage connectivity
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - nfs_configuration:
              - server_ip: "{{ nfs_configuration.server_ip }}"
                source_path: "{{ nfs_configuration.source_path }}"
                nfs_port: 2049
                nfs_version: nfs4
                nfs_portmapper_port: 111

# Example 2: Configure backup target with encryption and retention policies
- name: Configure backup target for automated data protection workflow
  hosts: localhost
  vars_files:
    - "credentials.yml"
    - "backup_secrets.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Configure backup target with encryption and data retention policies
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - backup_storage_configuration:
              - server_type: NFS
                nfs_details:
                  server_ip: "{{ nfs_configuration.server_ip }}"
                  source_path: "{{ nfs_configuration.source_path }}"
                  nfs_port: 2049
                  nfs_version: nfs4
                  nfs_portmapper_port: 111
                data_retention_period: 51
                encryption_passphrase: "{{ backup_storage_configuration.encryption_passphrase }}"

# Example 3: Create backup for systematic data preservation
- name: Create backup for automated network infrastructure backup
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Create backup with name and scope specifications
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - backup:
              - name: BACKUP24_07
                scope: CISCO_DNA_DATA_WITHOUT_ASSURANCE

# Example 4: Restore backup for disaster recovery operations
- name: Restore backup for disaster recovery and data restoration
  hosts: localhost
  vars_files:
    - "credentials.yml"
    - "backup_secrets.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Restore backup
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - restore_operations:
              - name: "BACKUP17_09"
                encryption_passphrase: "{{ restore_operations.encryption_passphrase }}"

# Example 5: Delete NFS configuration for infrastructure cleanup
- name: Remove NFS configuration from backup infrastructure
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Delete NFS configuration from backup infrastructure
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: deleted
        config:
          - nfs_configuration:
              - server_ip: "{{ nfs_configuration.server_ip }}"
                source_path: "{{ nfs_configuration.source_path }}"

# Example 6: Delete backup for lifecycle management
- name: Remove backup from automated backup operations
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Delete backup for backup lifecycle management
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: deleted
        config:
          - backup:
              - name: BACKUP24_07

# Example 7: Delete backups using retention policy with name prefix filtering
- name: Remove old backups using retention-based cleanup with name filtering
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Delete backups with prefix 'BACKUP03_10' older than 7 days using retention policy
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: deleted
        config:
          - backup:
              - name: BACKUP03_10
                backup_retention_days: 7

# Example 8: Delete backups with prefix 'BACKUP03_10' older than 7 days using retention policy
- name: Remove all old backups using retention policy
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Delete all backups older than 7 days retention policy
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: deleted
        config:
          - backup:
              - backup_retention_days: 7

# Example 9: Delete all backups for complete infrastructure cleanup
- name: Remove all backups from Cisco Catalyst Center
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Delete all existing backups for infrastructure cleanup
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: deleted
        config:
          - backup:
              - delete_all_backup: true

# Example 10: Comprehensive backup workflow for enterprise deployment
- name: Complete backup and restore workflow for enterprise infrastructure
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Configure comprehensive backup infrastructure with NFS and scheduling
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - nfs_configuration:
              - server_ip: "{{ nfs_configuration.server_ip }}"
                source_path: "{{ nfs_configuration.source_path }}"
                nfs_port: 2049
                nfs_version: nfs4
                nfs_portmapper_port: 111
            backup_configuration:
              - server_type: NFS
                nfs_details:
                  server_ip: "{{ backup_storage_configuration.server_ip }}"
                  source_path: "{{ backup_storage_configuration.source_path }}"
                  nfs_port: 2049
                  nfs_version: nfs4
                  nfs_portmapper_port: 111
                data_retention_period: 30
                encryption_passphrase: Enterprise@Backup2024
            backup:
              - name: ENTERPRISE_DAILY_BACKUP
                scope: CISCO_DNA_DATA_WITH_ASSURANCE

# Example 11: Multiple NFS server configuration for redundant backup storage
- name: Configure multiple NFS servers for backup redundancy
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Configure primary and secondary NFS servers for backup redundancy
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - nfs_configuration:
              - server_ip: "{{ nfs_configuration.server_ip }}"
                source_path: "{{ nfs_configuration.source_path }}"
                nfs_port: 2049
                nfs_version: nfs4
                nfs_portmapper_port: 111
              - server_ip: "{{ nfs_configuration.server_ip }}"
                source_path: "{{ nfs_configuration.source_path }}"
                nfs_port: 2049
                nfs_version: nfs4
                nfs_portmapper_port: 111

# Example 12: Create backup with timestamp prefix for automated backup workflows
- name: Create automated backup with timestamp for unique identification
  hosts: localhost
  vars_files:
    - "credentials.yml"
  connection: local
  gather_facts: false
  tasks:
    - name: Generate timestamped backup for automated data protection workflows
      cisco.dnac.backup_and_restore_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: DEBUG
        config_verify: true
        dnac_api_task_timeout: 1000
        dnac_task_poll_interval: 1
        state: merged
        config:
          - backup:
              - name: "DAILY_AUTO_BACKUP"
                scope: "CISCO_DNA_DATA_WITHOUT_ASSURANCE"
                generate_new_backup: true

Return Values

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

Key

Description

response_backup_created

dictionary

Confirms successful creation of backups for systematic data preservation with scope-based inclusion specifications.

Provides verification of backup operations for network infrastructure data protection and disaster recovery preparedness.

Returned: when backups is successfully created

Sample: {"changed": true, "msg": "Backup(s) 'ENTERPRISE_BACKUP_2024' created successfully in Cisco Catalyst Center.", "response": "Backup(s) 'ENTERPRISE_BACKUP_2024' created successfully in Cisco Catalyst Center."}

response_backup_deleted

dictionary

Confirms successful deletion of backups from automated backup operations for schedule lifecycle management.

Provides verification of backups cleanup for operational efficiency and resource management in backup infrastructure.

Returned: when backups is successfully deleted

Sample: {"changed": true, "msg": "Backup(s) 'LEGACY_BACKUP_2023' deleted successfully from Cisco Catalyst Center.", "response": "Backup(s) 'LEGACY_BACKUP_2023' deleted successfully from Cisco Catalyst Center."}

response_backup_restored

dictionary

Confirms successful restoration of network infrastructure data from encrypted backup for disaster recovery operations.

Validates data recovery completion with encryption passphrase authentication for secure backup restoration workflows.

Returned: when backup restoration is successfully completed

Sample: {"changed": true, "msg": "Backup(s) 'enterprise_backup_20240315' restored successfully in Cisco Catalyst Center.", "response": "Backup(s) 'enterprise_backup_20240315' restored successfully in Cisco Catalyst Center."}

response_backup_storage_configuration_created

dictionary

Confirms successful creation or update of backup target configuration including storage type, retention policies, and encryption settings.

Validates backup infrastructure readiness for automated data protection workflows in enterprise environments.

Returned: when backup configuration is successfully created or updated

Sample: {"changed": true, "msg": "Backup Configuration(s) '/home/nfsshare/backups/enterprise' created successfully in Cisco Catalyst Center.", "response": "Backup Configuration(s) '/home/nfsshare/backups/enterprise' created successfully in Cisco Catalyst Center."}

response_nfs_configuration_created

dictionary

Confirms successful creation of NFS server configuration for backup storage infrastructure in Cisco Catalyst Center.

Provides details about the configured NFS server path and connectivity status for backup operations.

Returned: when NFS configuration is successfully created

Sample: {"changed": true, "msg": "NFS Configuration(s) '/home/nfsshare/backups/enterprise' created successfully in Cisco Catalyst Center.", "response": "NFS Configuration(s) '/home/nfsshare/backups/enterprise' created successfully in Cisco Catalyst Center."}

response_nfs_configuration_deleted

dictionary

Confirms successful deletion of NFS server configuration from backup infrastructure for decommissioning or reconfiguration purposes.

Validates cleanup of backup storage connectivity for infrastructure lifecycle management and resource optimization.

Returned: when NFS configuration is successfully deleted

Sample: {"changed": true, "msg": "NFS Configuration(s) '/home/nfsshare/backups/legacy' deleted successfully from Cisco Catalyst Center.", "response": "NFS Configuration(s) '/home/nfsshare/backups/legacy' deleted successfully from Cisco Catalyst Center."}

response_no_changes_required

dictionary

Indicates that the requested backup and restore configuration already exists in the desired state, requiring no modifications.

Confirms idempotent operation completion with existing configuration validation for backup infrastructure consistency.

Returned: when configuration already exists in desired state

Sample: {"changed": false, "msg": "NFS Configuration(s) '/home/nfsshare/backups/existing' already exist in Cisco Catalyst Center.", "response": "NFS Configuration(s) '/home/nfsshare/backups/existing' already exist in Cisco Catalyst Center."}

response_operation_failed

dictionary

Provides detailed error information when backup and restore operations fail due to validation, connectivity, or configuration issues.

Includes specific failure reasons for troubleshooting backup infrastructure problems and operational recovery guidance.

Returned: when operations fail due to errors or validation issues

Sample: {"changed": false, "failed": true, "msg": "Mount path not retrievable as NFS node is unhealthy for server IP '172.27.17.90', source path '/home/nfsshare/backups/TB19'.", "response": "Mount path not retrievable as NFS node is unhealthy for server IP '172.27.17.90', source path '/home/nfsshare/backups/TB19'."}

Authors

  • Priyadharshini B (@pbalaku2)

  • Karthick S N (@kasn)

  • Madhan Sankaranarayanan (@madhansansel)