Hey folks, I’m trying to gather some facts from a Cisco ASA. The ASA is configured as simply as possible and here are the relevant settings for the ASA
ASA Software Version: 9.2(2)
Hardware: ASA5515
Management IP: 10.0.2.5
SSH DH Key Exchange: Group 1 (diffie-hellman-group1-sha1)
I made sure that I can SSH into the device directly from the Ansible VM before anything, and this was sucessful.
Ansible version is 2.5.2 (being run using the official ansible awx docker images)
Here is my inventory:
[cisco]
10.0.2.5
[cisco:vars]
ansible_user=myuseraccount
ansible_ssh_pass=mypass
ansible_ssh_common_args: ‘-o KexAlgorithms=diffie-hellman-group1-sha1’
Here is my playbook:
Also, I just turned on debug and this is what I see:
1492 1526674321.92274: stderr chunk (state=3):
debug3: receive packet: type 91
debug2: callback start
debug2: client_session2_setup: id 2
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 2: request env confirm 0
debug3: send packet: type 98
debug1: Sending command: /bin/sh -c ‘echo ~ && sleep 0’
debug2: channel 2: request exec confirm 1
debug3: send packet: type 98
debug3: mux_session_confirm: sending success reply
debug2: callback done
debug2: channel 2: open confirm rwindow 1024 rmax 4096
debug1: mux_client_request_session: master session id: 2
<<<
1492 1526674321.95154: stderr chunk (state=3):
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 2
debug2: exec request accepted on channel 2
<<<
1492 1526674321.95220: stdout chunk (state=3):
Type help or ‘?’ for a list of available commands.
/b<<<
1492 1526674321.95442: stdout chunk (state=3):
in/sh -c 'echo ~ &&<<<
1492 1526674321.97577: stdout chunk (state=3):
sleep 0’<<<
1492 1526674366.99164: stderr chunk (state=3):
debug3: send packet: type 1
<<<
1492 1526674366.99776: stderr chunk (state=3):
debug1: channel 0: free: /root/.ansible/cp/a0709b0bd0, nchannels 3
debug3: channel 0: status: The following connections are open:
#1 mux-control (t16 r2 i0/0 o0/0 fd 5/5 cc -1)
#2 client-session (t4 r3 i0/0 o0/0 fd 6/7 cc 1)
debug1: channel 1: free: mux-control, nchannels 2
debug3: channel 1: status: The following connections are open:
#1 mux-control (t16 r2 i0/0 o0/0 fd 5/5 cc -1)
#2 client-session (t4 r3 i0/0 o0/0 fd 6/7 cc 1)
debug1: channel 2: free: client-session, nchannels 1
debug3: channel 2: status: The following connections are open:
#2 client-session (t4 r3 i0/0 o0/0 fd 6/7 cc 1)
debug3: fd 0 is not O_NONBLOCK
debug3: fd 1 is not O_NONBLOCK
debug1: fd 2 clearing O_NONBLOCK
Connection to 10.0.2.5 closed by remote host.
Transferred: sent 2072, received 1984 bytes, in 45.1 seconds
Bytes per second: sent 45.9, received 44.0
debug1: Exit status -1
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Control master terminated unexpectedly
<<<
1492 1526674367.01129: stderr chunk (state=3):
<<<
1492 1526674367.01299: stdout chunk (state=3):
Few things that need to be corrected here…
-
use connection=network_cli
-
set the ansible_network_os=asa
-
use the asa_facts module, not ios_facts
http://docs.ansible.com/ansible/latest/network/index.html
Yea, I figured out point 1 eventually.
As for ansible_network_os, I couldn’t find that documentation anywhere as to the different options. I eventually guessed asa and it worked, but is it documented?
And where is the information on asa_facts? I could only find ios_facts. There were 3 different asa modules listed but none of them are _facts
Thank you!
Hey Peter, was this what you mean by the asa_facts module? https://github.com/ansible/ansible/pull/37298
It looks like it’s not included yet