Software Development Kit (SDK) and API Discussions

Ansible with ontap 8.3

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

6 REPLIES 6

Re: Ansible with ontap 8.3

can you out put the command in the filer

"network interface show"

 

 

Re: Ansible with ontap 8.3

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

Re: Ansible with ontap 8.3

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

Re: Ansible with ontap 8.3

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. 

Re: Ansible with ontap 8.3

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

 

Re: Ansible with ontap 8.3

This is been resolved

Forums