Skip to content

cli_backup

Collection Note

This module is part of the ansible.netcommon collection. To install the collection, use:

ansible-galaxy collection install ansible.netcommon
Added in version 4.2.0.

Synopsis

  • This module provides platform agnostic way of backing up text based configuration from network devices over network_cli connection plugin.

Parameters

Parameter Defaults / Choices Comments
defaults
bool
The I(defaults) argument will influence how the running-config is collected from the device. When the value is set to true, the command used to collect the running-config is append with the all keyword. When the value is set to false, the command is issued without the all keyword.
dir_path
path
This option provides the path ending with directory name in which the backup configuration file will be stored. If the directory does not exist it will be first created and the filename is either the value of C(filename) or default filename as described in C(filename) options description. If the path value is not given in that case a I(backup) directory will be created in the current working directory and backup configuration will be copied in C(filename) within I(backup) directory.
filename
str
The filename to be used to store the backup configuration. If the filename is not given it will be generated based on the hostname, current time and date in format defined by _config.@

Notes

Note

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

Examples

- name: configurable backup path
  ansible.netcommon.cli_backup:
    filename: backup.cfg
    dir_path: /home/user

Return Values

Key Data Type Description Returned
backup_path str The full path to the backup file always

Authors

  • Katherine Case (@qalthos)