ansible.netcommon.cli_backup module – Back up device configuration from network devices over network_cli
Note
This module is part of the ansible.netcommon collection (version 6.1.3).
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_backup
.
New in ansible.netcommon 4.2.0
Synopsis
- This module provides platform agnostic way of backing up text based configuration from network devices over network_cli connection plugin.
Note
This module has a corresponding action plugin.
Parameters
Parameter | Comments |
---|---|
defaults boolean | The 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. Choices:
|
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 |
filename string | 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 <hostname>_config.<current-date>@<current-time> |
Notes
Note
- This module is supported on
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
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
---|---|
backup_path string | The full path to the backup file Returned: always Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_backup_module.html