# Issues connecting when using the ios\_facts module

**URL:** <https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563>\
**Category:** Ansible Project\
**Tags:** awx\
**Created:** [May 18, 2018, 8:11pm UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563 "2018-05-18T20:11:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [May 18, 2018, 8:11pm UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563/1 "2018-05-18T20:11:06Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [May 18, 2018, 8:18pm UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563/2 "2018-05-18T20:18:50Z")

</div>

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):

---

<div class="post-metadata">

**Author:** ![psprygad](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@psprygad](https://forum.ansible.com/u/psprygad)\
**Post date:** [May 19, 2018, 2:25am UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563/3 "2018-05-19T02:25:37Z")

</div>

Few things that need to be corrected here…

1. use connection=network\_cli

2. set the ansible\_network\_os=asa

3. use the asa\_facts module, not ios\_facts

[http://docs.ansible.com/ansible/latest/network/index.html](http://docs.ansible.com/ansible/latest/network/index.html)

---

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [May 19, 2018, 5:59am UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563/4 "2018-05-19T05:59:01Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Matt\_Hickok](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@Matt\_Hickok](https://forum.ansible.com/u/Matt_Hickok)\
**Post date:** [May 21, 2018, 2:56pm UTC](https://forum.ansible.com/t/issues-connecting-when-using-the-ios-facts-module/27563/5 "2018-05-21T14:56:03Z")

</div>

Hey Peter, was this what you mean by the asa\_facts module? [https://github.com/ansible/ansible/pull/37298](https://github.com/ansible/ansible/pull/37298)

It looks like it’s not included yet
