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?
“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.
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