ansible.netcommon.cli_restore module – Restore device configuration to network devices over network_cli

Note

This module is part of the ansible.netcommon collection (version 6.1.1).

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 ansible.netcommon.

To use it in a playbook, specify: ansible.netcommon.cli_restore.

New in ansible.netcommon 6.1.0

Synopsis

  • This module provides platform agnostic way of restore text based configuration to network devices over network_cli connection plugin.

  • The module uses the platforms `config replace` commands to restore backup configuration that is already copied over to the appliance.

Parameters

Parameter

Comments

filename

string

Filename of the backup file, present in the appliance where the restore operation is to be performed. Check appliance for the configuration backup file name.

path

string

The location in the target appliance where the file containing the backup exists. The path and the filename together create the input to the config replace command,

For an IOSXE appliance the path pattern is flash://<filename>

Notes

Note

  • This module is supported on ansible_network_os network platforms. See the :ref:`Network Platform Options <platform_options>` for details.

Examples

- name: Restore IOS-XE configuration
  ansible.netcommon.cli_restore:
    filename: backupDday.cfg
    path: flash://

# Command fired
# -------------
# config replace flash://backupDday.cfg force

# Task Output
# -----------
#
# ok: [BATMON] => changed=false
#   __restore__: |-
#     The rollback configlet from the last pass is listed below:
#     ********
#     !List of Rollback Commands:
#     Building configuration...
#     Current configuration : 3781 bytes
#     end
#     ********
#
#
#     Rollback aborted after 5 passes
#     The following commands are failed to apply to the IOS image.
#     ********
#     Building configuration...
#     Current configuration : 3781 bytes
#     ********
#   invocation:
#     module_args:
#       filename: backupDday.cfg

Authors

  • Sagar Paul (@KB-perByte)