# Can network\_cli or expect run tasks via SSH on simple embedded devices?

**URL:** <https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767>\
**Category:** Ansible Project\
**Created:** [February 25, 2019, 4:29pm UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767 "2019-02-25T16:29:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeWaffle](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@CodeWaffle](https://forum.ansible.com/u/CodeWaffle)\
**Post date:** [February 25, 2019, 4:29pm UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767/1 "2019-02-25T16:29:49Z")

</div>

Hi all:

Not sure if I’m going about this the right way since I’m pretty new to Ansible.

Bu, can something like “network\_cli” be used to drive simple to simple embedded devices over SSH in an expect-like manner?

I’ve got a few devices that don’t have a custom network\_os or custom Ansible module defined. They also don’t have a full shell and just expose a simple command-line REPL.

Some simple pxssh script might work too, but it would seem nice to expose these steps as first-class Ansible tasks too.

If this is doable via Ansible in a nice manner, can someone point me to the docs that cover this kind of use case?

Thank you!

---

<div class="post-metadata">

**Author:** ![ganeshrn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ganeshrn/32/1021_2.png) [@ganeshrn](https://forum.ansible.com/u/ganeshrn)\
**Post date:** [February 27, 2019, 5:51am UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767/2 "2019-02-27T05:51:45Z")

</div>

“network\_cli” connection plugin creates a pseudo terminal on the control node which establishes ssh connection with target host.So ideally it can be used to talk to any SSH-based target host. network\_cli connection plugin relies on value of ansible\_network\_os  
config variable to load the appropriate terminal and cliconf plugin for the target host.

Fore more details refer: [https://github.com/ansible/community/blob/master/group-network/network\_dev\_network\_cli.rst](https://github.com/ansible/community/blob/master/group-network/network_dev_network_cli.rst)

---

<div class="post-metadata">

**Author:** ![CodeWaffle](https://avatars.discourse-cdn.com/v4/letter/c/5f8ce5/32.png) [@CodeWaffle](https://forum.ansible.com/u/CodeWaffle)\
**Post date:** [February 28, 2019, 12:31am UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767/3 "2019-02-28T00:31:45Z")

</div>

Hi Ganesh:

I have indeed seen the docs you point to below, but the next question remains: What is the correct value for “ansible\_network\_os”?

---

<div class="post-metadata">

**Author:** ![ganeshrn](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ganeshrn/32/1021_2.png) [@ganeshrn](https://forum.ansible.com/u/ganeshrn)\
**Post date:** [February 28, 2019, 6:29am UTC](https://forum.ansible.com/t/can-network-cli-or-expect-run-tasks-via-ssh-on-simple-embedded-devices/29767/4 "2019-02-28T06:29:28Z")

</div>

The value depends on the name of the new terminal/cliconf plugin file added to support the new OS.So if the plugin file name is ‘foo.py’ the value of ansible\_network\_os should be ‘foo’.

The ansible\_network\_os value is used to load the right terminal
