user97
(Николай Самохин)
October 20, 2021, 5:45am
1
Hello everyone,
AWX 19.4.0 in minikube v1.23.1
Playbook code is
name: Get running-config and save it
ios_config:
backup: yes
backup_options:
filename: “{{ ansible_net_hostname }}_{{ ansible_host }}.cfg”
dir_path: …/cisco/backup/{{ ansible_net_hostname }}/{{ date.stdout }}at {{ time.stdout }}
TASK [Get running-config and save it] ******************************************14:58:54
30
changed: [IL-SW-001] => {“backup_path”: “…/cisco/backup/IL-SW-001/2021-Oct-20_at_04:58/IL-SW-001_10.1.21.5.cfg”, “changed”: true, “date”: “2021-10-20”, “time”: “04:58:57”}
Im pasted pwd command to check path - its OK
ffirg
(Phil Griffiths)
October 21, 2021, 9:06am
2
The job is running inside a mutable container, so it’s succesfully running the module and creating the output, but the container is then destroyed after the automation run. You need to store the file somewhere for persistence outside the container.
How to save config on remote location (storage server)
If you have received the file from the device you may be able to send it somewhere using the synchronize module.
https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html