-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Hey,
in the aoscx_backup_config module there is an option to specify the config_name to backup, yet it always returns the running-config.
Collection:
arubanetworks.aoscx 4.4.0
Ansible Version:
ansible [core 2.16.7]
CX switch:
Aruba CX 6200F, Version ArubaOS-CX ML.10.10.1060
This is my playbook:
---
- hosts: arubacx
collections:
- arubanetworks.aoscx
vars:
ansible_python_interpreter: /usr/bin/python3
gather_facts: False
tasks:
- name: Copy Startup Config to local as JSON
aoscx_backup_config:
config_name: startup-config
output_file: /path/to/file/startup-config.json
This was tested with the names of the startup-config and checkpoints, but it always returned the running-config
This is a part of the output from debug with -vvv:
changed: [aoscx_1] => {
"changed": true,
"invocation": {
"module_args": {
"config_name": "startup-config",
"config_type": "json",
"output_file": "/path/to/file/startup-config.json",
"remote_output_file_tftp_path": null,
"sort_json": true,
"vrf": null
}
}
}
I also tested the switch REST API with Postman using the API /fullconfigs/{name} and /configs/{name}.
Tested with https://<ip-address>/rest/v10.10/fullconfigs/startup-config
which returns the correct configuration.
https://<ip-address>/rest/v10.10/configs/startup-config
returns the correct configuration as well.
Another nice thing would be to be able to save the CLI version of the config locally via API, or at least have the option to display it in the output for better readability without using SSH.