How do I run ansible command on non-win/lin host ?

39 views
Skip to first unread message

Irek Romaniuk

unread,
Mar 6, 2015, 8:06:43 AM3/6/15
to ansible...@googlegroups.com
How do I run command without playbook on non-win/lin host ? 

[irekr@nms02 ansible]$ ansible cp11 -i hosts -c local -a "show software-version"
Irek-11 | FAILED | rc=2 >>
[Errno 2] No such file or directory

see below my hosts file

[irekr@nms02 ansible]$ cat hosts
[local]
localhost
[cp11]
Irek-11 ansible_ssh_host=10.199.107.1 ansible_ssh_user=admin 

and how do I run this command from ssh


[irekr@nms02 ansible]$ ssh -l admin 10.199.107.1
ad...@10.199.107.1's password: 
Irek-11> show software-version
This is Check Point 1100 Appliance R75.20.60 - Build 984
Irek-11> exit
Connection to 10.199.107.1 closed.

Dan Vaida

unread,
Mar 7, 2015, 11:37:15 AM3/7/15
to ansible...@googlegroups.com
It depends on the SSH implementation on such devices. This is a fairly common situation with network devices, etc. which most of the times come with a minimalistic SSH.
I remembered a thread that was quite good at detailing some gotchas in these use cases of Ansible. 
I am linking to Mark's reply: https://groups.google.com/forum/#!searchin/ansible-project/tty/ansible-project/GEwuvE5GmpM/WQyIFWkjn0QJ but I advise you to closely read all the thread.

I believe I saw another 2-3 such threads on the mailing list. 

Hope this helps, Dan.
Reply all
Reply to author
Forward
0 new messages