Software Development Kit (SDK) and API Discussions

Ansible with ontap 8.3

naveens17

I am checking ping command with ansible to NetApp simulator  , it is throwing me the below error messages

 

ansible -i filers 192.168.191.18 -m command -a "ping" -vvv
ansible 2.6.5
config file = /home/ansible/ansible.cfg
configured module search path = [u'/home/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.14 (default, Mar 14 2018, 16:45:33) [GCC 8.0.1 20180222 (Red Hat 8.0.1-0.16)]
Using /home/ansible/ansible.cfg as config file
Parsed /home/ansible/filers inventory source with ini plugin
META: ran handlers
<192.168.191.18> ESTABLISH SSH CONNECTION FOR USER: admin
<192.168.191.18> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/82790327ae 192.168.191.18 '/bin/sh -c '"'"'echo ~admin && sleep 0'"'"''
<192.168.191.18> (255, '\x07\r\nError: "/bin/sh" is not a recognized command\r\n\r\n', '')
192.168.191.18 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ",
"unreachable": true
}

 

Here is the inventory file

 

cat filers
[prod]
192.168.191.18 ansible_ssh_pass='XXXXX' ansible_user='admin'

 

any thoughts..

1 ACCEPTED SOLUTION

naveens17

This is been resolved

View solution in original post

7 REPLIES 7

naveens17

This is been resolved

View solution in original post

netappmagic

Hi, What is your solution?  I have exactly the same issue. 

 

"ansible 192.168.191.18 -i filers -m ping" is not working neither. /bin/sh is not recognized command, that is the error when I use "-vvv" option. 

 

Thanks,

 

 

renem

According to the ansible documentation the module "command" execute a command on a remote system. I guess you want to ping the filer from the ansible host.  If so then try with the module "ping"

 

ansible 192.168.191.18 -i filers -m ping

 

gaurav_verma

I dont think you can setup direct connection as netapp module for ansible takes care of connection as well with both cluster and svm. 

I mean in module itself you pass the login credentails and you specifiy protocols, certificates etc. 

AlexSun0302

can you out put the command in the filer

"network interface show"

 

 

naveens17

ansible -i filers 192.168.191.18 -m command -a "network interface show" -vvv
ansible 2.6.5
config file = /home/ansible/ansible.cfg
configured module search path = [u'/home/ansible/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.14 (default, Mar 14 2018, 16:45:33) [GCC 8.0.1 20180222 (Red Hat 8.0.1-0.16)]
Using /home/ansible/ansible.cfg as config file
Parsed /home/ansible/filers inventory source with ini plugin
META: ran handlers
<192.168.191.18> ESTABLISH SSH CONNECTION FOR USER: admin
<192.168.191.18> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=admin -o ConnectTimeout=10 -o ControlPath=/home/ansible/.ansible/cp/82790327ae 192.168.191.18 '/bin/sh -c '"'"'echo ~admin && sleep 0'"'"''
<192.168.191.18> (255, '\x07\r\nError: "/bin/sh" is not a recognized command\r\n\r\n', '')
192.168.191.18 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ",
"unreachable": true

AlexSun0302

Hmm, I mean directly using SSH to connect filer and run the command with out the Ansible

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public