Software Development Kit (SDK) and API Discussions

Ansible with ontap 8.3

naveens17
6,756 Views

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
6,302 Views

This is been resolved

View solution in original post

8 REPLIES 8

AlexSun0302
6,727 Views

can you out put the command in the filer

"network interface show"

 

 

naveens17
6,704 Views

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
6,696 Views

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

gaurav_verma
6,503 Views

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. 

renem
6,427 Views

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

 

naveens17
6,303 Views

This is been resolved

netappmagic
5,082 Views

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,

 

 

srinath49
1,764 Views

whats the solution Naveen?

Public