Trouble in using netscaler module of ansible

Hi,

I am trying to use netscaler module of ansible like below:-

“ansible host -m netscaler -a “nsc_host=10.102.56.141 user=nsroot password=nsroot””

But I am getting the below error:-

‘ERROR! Specified hosts and/or --limit does not match any hosts’

Even with -vvv ,I get the following:-

“[root@localhost roles]# ansible host -m netscaler -a “nsc_host=10.102.56.141 user=nsroot password=nsroot” -vvv
Using /etc/ansible/ansible.cfg as config file
ERROR! Specified hosts and/or --limit does not match any hosts”

Can anybody help me how to connect to netscaler with ansible. The ansible ping gives following error:-

“[root@localhost roles]# ansible 10.102.56.143 -m ping -vvv
Using /etc/ansible/ansible.cfg as config file
<10.102.56.143> ESTABLISH SSH CONNECTION FOR USER: None
<10.102.56.143> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 10.102.56.143 '/bin/sh -c '”‘"’( umask 77 && mkdir -p “echo /tmp/ansible/$USER/ansible-tmp-1480696563.27-207661911591794” && echo ansible-tmp-1480696563.27-207661911591794=“echo /tmp/ansible/$USER/ansible-tmp-1480696563.27-207661911591794” ) && sleep 0’“'”‘’
10.102.56.143 | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh.”,
“unreachable”: true
}
"

Hi Can someone please help me with this?

Can you try

ansible localhost -m netscaler -a “nsc_host=10.102.56.141 user=nsroot password=nsroot” -vvv

​Serge​

Hi Serge,

I tried the following:-

[root@localhost ~]# ansible localhost -m netscaler -a “nsc_host=10.102.56.141 user=nsroot password=nsroot” -vvv
Using /etc/ansible/ansible.cfg as config file
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /tmp/ansible/$USER/ansible-tmp-1481150804.2-134977495866272” && echo ansible-tmp-1481150804.2-134977495866272=“echo /tmp/ansible/$USER/ansible-tmp-1481150804.2-134977495866272” ) && sleep 0’
<127.0.0.1> PUT /tmp/tmp8MRvit TO /tmp/ansible/root/ansible-tmp-1481150804.2-134977495866272/netscaler
<127.0.0.1> EXEC /bin/sh -c ‘LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /tmp/ansible/root/ansible-tmp-1481150804.2-134977495866272/netscaler; rm -rf “/tmp/ansible/root/ansible-tmp-1481150804.2-134977495866272/” > /dev/null 2>&1 && sleep 0’
localhost | FAILED! => {
“changed”: false,
“failed”: true,
“invocation”: {
“module_args”: {
“action”: “enable”,
“name”: “localhost.localdomain”,
“nsc_host”: “10.102.56.141”,
“nsc_protocol”: “https”,
“password”: “nsroot”,
“type”: “server”,
“user”: “nsroot”,
“validate_certs”: true
},
“module_name”: “netscaler”
},
“msg”: “Failed to validate the SSL certificate for 10.102.56.141:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine or you can install the urllib3, pyopenssl, ndg-httpsclient, and pyasn1 python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible”
}

Do we need to install python on the netscaler ? no permission for that though.