# ansible 2.0.1.0 run show version with Cisco ASA-55x0

**URL:** <https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625>\
**Category:** Ansible Project\
**Created:** [June 1, 2016, 6:59am UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625 "2016-06-01T06:59:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludi\_Fang](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@Ludi\_Fang](https://forum.ansible.com/u/Ludi_Fang)\
**Post date:** [June 1, 2016, 6:59am UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/1 "2016-06-01T06:59:34Z")

</div>

**I could login the cisco device with SSH and run the show version successfully.**

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 22, 2016, 4:25pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/2 "2016-07-22T16:25:31Z")

</div>

Did you ever find a fix for this? I’m seeing the same error when connecting to an ASA 5505.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 22, 2016, 5:53pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/3 "2016-07-22T17:53:40Z")

</div>

I think I have found the cause of this message.

ios\_command module seems to run “terminal length 0” on the iOS target so that the output is displayed without any breaks. However this command is only valid against Cisco routers and switches. The proper command for an ASA is “terminal pager 0”. So naturally with terminal length 0 is executed, iOS generates an error, and execution of the playbook is halted.

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [July 22, 2016, 7:01pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/4 "2016-07-22T19:01:08Z")

</div>

There are now ASA specific modules available in extras ([https://github.com/ansible/ansible-modules-extras/tree/devel/network/asa](https://github.com/ansible/ansible-modules-extras/tree/devel/network/asa)) I would recommend using those for management of ASA devices.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 22, 2016, 7:02pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/5 "2016-07-22T19:02:06Z")

</div>

Yep - those don’t work for me. I don’t have ASA v 9.3 which is a requirement for those ASA modules.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 22, 2016, 9:54pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/6 "2016-07-22T21:54:51Z")

</div>

Yes, there are ASA specific modules. But those modules require ASA v9.3 and use Cisco’s REST API introduced in ASA v9.3. For anyone not wishing to use the REST API or who does not have ASA v9.3, those ASA modules do not work. In addition, it doesn’t appear that those modules are ready for “production” use yet. According to the developer on his own website - he is still testing, asking for help testing, He’s still finding bugs (normal even after release). Some his own, and some are bugs in Cisco’s REST API.

Now - to post what I found wrong because you didn’t publish it the first time…

Ansible’s ios\_command module tries to run the command “terminal length 0” to disable breaks which would require the user to interact and “continue” the output. The problem with this is that the “terminal length 0” command only works on Cisco routers and switches. The appropriate command for an ASA is “terminal pager 0”.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 22, 2016, 9:59pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/7 "2016-07-22T21:59:58Z")

</div>

You should at least post my Answer about the error so that others who might encounter it can quickly and easily discover the cause rather than continue digging into possible causes while beating their head against a wall because it doesn’t work.

---

<div class="post-metadata">

**Author:** ![Brandon](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@Brandon](https://forum.ansible.com/u/Brandon)\
**Post date:** [July 28, 2016, 2:53pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/8 "2016-07-28T14:53:40Z")

</div>

I’ve found that by copying and modifying ios.py in …/ansible/module\_utils/ and then pointing ios\_template to this new module its easy to change “terminal length 0” to “terminal pager 0”. Doing so, however, has apparently broken something else because now Ansible does not interpret templates correctly and sends the template name as a command, instead of parsing the template and executing the contents. If anyone has a solution for that I’d be glad to hear it.

NOTICE: The information contained in this email may be confidential, proprietary and/or legally privileged. It has been sent for the sole use of the intended recipient(s). If the reader of this message is not an intended recipient, you are hereby notified that any unauthorized review, use, disclosure, dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please reply to the sender and destroy all copies of the message. Thank you.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 28, 2016, 6:43pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/9 "2016-07-28T18:43:26Z")

</div>

Yep, I did the same thing. I haven’t had the chance to try running it to see if I got any errors.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [July 29, 2016, 8:13pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/10 "2016-07-29T20:13:16Z")

</div>

Also, just FYI - according to the REST API documentation, the ASA REST API is not supported with the ASA 5505.

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [August 3, 2016, 12:38pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/11 "2016-08-03T12:38:17Z")

</div>

The ASA modules in extras are CLI based not REST based so there is no dependency on REST API. Not sure about the 9.3 requirement, I don’t see that anywhere in the module docstring.

Agreed that the modules are currently part of devel and not ready for production use yet (as in still be tested) but going down the path of force fitting ios\_command to fill that role is no more or no less ready for production as it isn’t tested against ASA devices

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [August 4, 2016, 3:14pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/12 "2016-08-04T15:14:12Z")

</div>

Well I apologize. I found an ASA module that uses the REST API and that is the module I was referring to. I found the asa\_command module you’re referring to and ha I’ve tried it. Basically I replaced ios\_command with asa\_command and command with commands. The playbook will not run.

Can you provide a good known working playbook example?

YAML:

---

<div class="post-metadata">

**Author:** ![Brandon](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@Brandon](https://forum.ansible.com/u/Brandon)\
**Post date:** [August 4, 2016, 4:19pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/13 "2016-08-04T16:19:29Z")

</div>

You need one more space in front of your “commands:”.

This is correct:

`

- hosts: 192.168.0.1  
gather\_facts: False  
connection: local

tasks:

- asa\_command:  
commands:
- sh ver

`

A YAML parser like [http://yaml-online-parser.appspot.com/](http://yaml-online-parser.appspot.com/) is super helpful in debugging little syntax things like that sometimes.

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [August 4, 2016, 7:26pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/14 "2016-08-04T19:26:01Z")

</div>

That doesn’t seem to do it. I tried the YAML parser. I even copied and pasted from the parser. I still get the same exact error. I also tried moving the Host option under asa\_command.

 ![Inline image 1](https://us1.discourse-cdn.com/ansible/original/2X/c/c4842fc28ac4f2f7c266fa8129b3d73de03aec82.png)

 ![Inline image 2](https://us1.discourse-cdn.com/ansible/original/2X/f/ff8e3cda6a3f96ee2b86ed3ac69387af8cc03eef.png)

 ![Inline image 3](https://us1.discourse-cdn.com/ansible/original/2X/f/f192deafc84c902b58820f945e0112dd21f274fb.png)

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [August 7, 2016, 2:38pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/15 "2016-08-07T14:38:14Z")

</div>

> The asa\_\* commands are not part of latest Ansible version (2.1.1.0) yet.

You need to clone the repository [https://github.com/ansible/ansible-modules-extras](https://github.com/ansible/ansible-modules-extras) and modify ansible’s configuration to point to your local folder in /etc/ansible/ansible.cfg with “library = …”

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [August 8, 2016, 4:35pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/16 "2016-08-08T16:35:04Z")

</div>

OK, any other ideas? I cloned the repository. I edited ansible.cfg. I also tried the --module-path command line parameter. But all I get is this error about not being able to find the asa\_command module:

TASK [asa\_command] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [asa5505]: FAILED! =\> {“failed”: true, “msg”: “Could not find imported module support code for asa\_command. Looked for either \* or asa”}

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [August 9, 2016, 11:50am UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/17 "2016-08-09T11:50:48Z")

</div>

can you paste a copy of ansible --version into this thread? I suspect you are not running the latest version from devel

---

<div class="post-metadata">

**Author:** ![Tony\_R](https://avatars.discourse-cdn.com/v4/letter/t/aeb1de/32.png) [@Tony\_R](https://forum.ansible.com/u/Tony_R)\
**Post date:** [August 9, 2016, 12:10pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/18 "2016-08-09T12:10:41Z")

</div>

You’re right, I’m not running from devel. I’m running Latest Release from Apt.

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [August 9, 2016, 2:42pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/19 "2016-08-09T14:42:45Z")

</div>

> To install from official PPA for Ubuntu: [http://docs.ansible.com/ansible/intro\_installation.html#latest-releases-via-apt-ubuntu](http://docs.ansible.com/ansible/intro_installation.html#latest-releases-via-apt-ubuntu)

Another way is through pip: sudo pip install ansible

---

<div class="post-metadata">

**Author:** ![actionmystique](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/actionmystique/32/1678_2.png) [@actionmystique](https://forum.ansible.com/u/actionmystique)\
**Post date:** [August 9, 2016, 2:50pm UTC](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625/20 "2016-08-09T14:50:01Z")

</div>

If you want the very latest builds (stable & RC release candidates), you can use my own PPA (only for Ubuntu 16.04) which also distributes many other fresh packages.

[Next page](https://forum.ansible.com/t/ansible-2-0-1-0-run-show-version-with-cisco-asa-55x0/21625.md?page=2)
