Rebooting a Cisco ASA device

29 views
Skip to first unread message

Sahar

unread,
Jan 3, 2019, 5:56:41 PM1/3/19
to Ansible Project
I'm trying to reboot a Cisco ASA Firewall, and run the "show version" command after it. It seems that rebooting works, but when the playbook gets to the show version command, it will get failed by showing the error down below. Any idea about it? 





- name: Rebooting the ASA
  asa_command:
    commands:
    - "reload\n"


- wait_for: timeout=180


- name: check the version
  asa_command:
    commands:
    -  show version
  register: output


- name: check the version
  debug: var=output.stdout





TASK [Rebooting the ASA] ***********************************************************************************************************

TASK [wait_for] ********************************************************************************************************************


TASK [check the version] ************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: Socket is closed
fatal: [Fw4Script-01.tor.bellnhs.int]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/home/shdianat/.ansible/tmp/ansible-local-12216t0E3Bw/ansible-tmp-1546555792.58-98199446309935/AnsiballZ_asa_command.py\", line 113, in <module>\n    _ansiballz_main()\n  File \"/home/shdianat/.ansible/tmp/ansible-local-12216t0E3Bw/ansible-tmp-1546555792.58-98199446309935/AnsiballZ_asa_command.py\", line 105, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/shdianat/.ansible/tmp/ansible-local-12216t0E3Bw/ansible-tmp-1546555792.58-98199446309935/AnsiballZ_asa_command.py\", line 48, in invoke_module\n    imp.load_module('__main__', mod, module, MOD_DESC)\n  File \"/tmp/ansible_asa_command_payload_4Z1mL_/__main__.py\", line 195, in <module>\n  File \"/tmp/ansible_asa_command_payload_4Z1mL_/__main__.py\", line 165, in main\n  File \"/tmp/ansible_asa_command_payload_4Z1mL_/ansible_asa_command_payload.zip/ansible/module_utils/network/asa/asa.py\", line 124, in run_commands\n  File \"/tmp/ansible_asa_command_payload_4Z1mL_/ansible_asa_command_payload.zip/ansible/module_utils/connection.py\", line 173, in __rpc__\nansible.module_utils.connection.ConnectionError: Socket is closed\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}




These are the parameters in ansible.cfg file:

[persistent_connection]

connect_timeout = 300
command_timeout = 300

Ganesh Nalawade

unread,
Jan 4, 2019, 2:55:10 AM1/4/19
to Ansible Project
Try adding "meta: reset_connection" after wait_for task and before check version task.
Also, which Ansible version are you using?

Regards,
Ganesh

Veera Kumar

unread,
Jan 4, 2019, 3:49:08 AM1/4/19
to ansible...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f31d7777-7e0c-4eec-a39e-96aee001f124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sahar

unread,
Jan 4, 2019, 10:41:28 AM1/4/19
to Ansible Project
Thanks. My ansible version is:  2.7.4. This command let me proceed. Is this a normal output?

TASK [wait_for] ********************************************************************************************************************
 [WARNING]: reset_connection task does not support when conditional

TASK [show version on ASA Firewall] ************************************************************************************************




My ansible version is:  2.7.4
Reply all
Reply to author
Forward
0 new messages