# How do I run commands such as against generic network devices

**URL:** <https://forum.ansible.com/t/how-do-i-run-commands-such-as-against-generic-network-devices/29430>\
**Category:** Ansible Project\
**Created:** [January 13, 2019, 4:17pm UTC](https://forum.ansible.com/t/how-do-i-run-commands-such-as-against-generic-network-devices/29430 "2019-01-13T16:17:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jarett\_Chaiken](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@Jarett\_Chaiken](https://forum.ansible.com/u/Jarett_Chaiken)\
**Post date:** [January 13, 2019, 4:17pm UTC](https://forum.ansible.com/t/how-do-i-run-commands-such-as-against-generic-network-devices/29430/1 "2019-01-13T16:17:04Z")

</div>

All,

I’m just beginning discovery of using ansible in my environment, and am trying to get an understanding of its capabilities.

I’ve been trying to figure out how to send command to generic network devices. That is devices with no module, and not an option in ansible\_network\_os. For example, old HP Procurve switches, or menu driven devices such as Adtran muxes.

I assume I’ll be a little limited to what I can do, but I would think that raw and/or expect could be made to work

The errors I’m getting are similar to:

…  
“stderr”: “/bin/sh: 1: -c not found\n”,  
…

I’ve tried it adhoc like:

ansible TEST -c local -u username -k -m raw -a “show run” # Not the actual command, I’m doing it from memory

or in a playbook such as:

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [January 13, 2019, 7:07pm UTC](https://forum.ansible.com/t/how-do-i-run-commands-such-as-against-generic-network-devices/29430/2 "2019-01-13T19:07:48Z")

</div>

raw might work depending on device, but expect will always work as long as the device give some kind out prompt.
