Open iamgini opened 2 years ago
@ginigangadharan Thanks for raising the issue, I wanted to check if you're able to achieve the expected outcome from the cmd: copy /noconfirm running-config tftp://10.1.10.10/ASA-DEMO-20220817-151253.cfg
when directly fired through Cisco ASA config, as invalid input is the error received from the ASA config.
Hi @justjais Yes, I am able to run the same command from the switch console manually without any issue and the command will complete successfully.
@ginigangadharan Thanks for the quick response, I'll triage the issue and update asap
Thank you @justjais I am trying from my side as well but couldnt find the issue.
I will wait for your update.
Hi @justjais, Just checking if you find any good news on this.
Thank you :D
@ginigangadharan please excuse me for the delayed response, the entire team was involved in Ansiblefest which got concluded recently. I'll triage the issue and update you ASAP.
@justjais thank you so much. Hope you had great experience there in AnsibleFest :)
@ginigangadharan I've verified the issue from my end but I am unable to reproduce the said error, please find my config below: Play:
---
- name: CISCO ASA tasks
hosts: asa
collections:
- cisco.asa
gather_facts: false
vars:
tftp_server: 10.1.10.10
backup_filename: ASA-backup-test
tasks:
- name: Take Cisco ASA Backup
tags: asa_177
cisco.asa.asa_command:
commands:
- "copy /noconfirm running-config tftp://{{ tftp_server }}/{{ backup_filename }}"
register: tftp_copy_status
Inventory:
[asa:vars]
ansible_ssh_host=44.242.148.15
ansible_user=admin
ansible_become=true
ansible_become_method=ansible.netcommon.enable
ansible_become_pass=admin
ansible_connection=network_cli
ansible_network_os=asa
ansible_python_interpreter=python
Ansible version:
ansible-playbook [core 2.13.5]
config file = ./ansible.cfg
configured module search path = ['.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
ansible collection location = /Users/sjaiswal/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible-playbook
python version = 3.9.13 (main, May 24 2022, 21:28:44) [Clang 13.0.0 (clang-1300.0.29.30)]
jinja version = 3.0.1
libyaml = True
Play run:
ok: [44.242.148.15] => changed=false
invocation:
module_args:
authorize: null
commands:
- copy /noconfirm running-config tftp://10.1.10.10/ASA-backup-test
context: null
interval: 1
match: all
passwords: null
provider: null
retries: 10
wait_for: null
stdout:
- |-
Cryptochecksum: 5646dd91 76be5088 1b625b61 bdc47e3b
%Error writing tftp://10.1.10.10/ASA-backup-test (Timed out attempting to connect)
stdout_lines: <omitted>
META: ran handlers
META: ran handlers
PLAY RECAP ***********************************************************************************************************************************************************************
44.242.148.15 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Cisco ASA detail:
Cisco Adaptive Security Appliance Software Version 9.18(1)
SSP Operating System Version 2.12(0.31)
Device Manager Version 7.18(1)
Can you run the play appending -vvvv
with play run to get the detailed verbose output and share the play run?
@ginigangadharan were you able to check on this issue?
@justjais apologies for my delayed response. I have tried but it was not working. I missed to collect and share the logs. I will try and update you by next week (as I am travelling now)
Thank you for checking this.
SUMMARY
Since the
cisco.asa.asa_config
module backup is downloading the backup to localmachine, we are using thecisco.asa.asa_command
module and run arbitrary commands to take the backup directly to the TFTP server as follows.But the command fails with below message
ISSUE TYPE
COMPONENT NAME
asa_command
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible: Red Hat Enterprise Linux 8.5.0-3 (Ansible execution environment container image; also tested on different machine with Python virtual environment)
Cisco ASA:
STEPS TO REPRODUCE
Execute the following playbook on one or more Cisco ASA device.
EXPECTED RESULTS
The command executes successfully and the backup file transfer to the TFTP server.
ACTUAL RESULTS
Task fails with following error message