Ansible netscaler模块出现错误“;味精:&引用';非类型';对象没有属性';阅读'&引用;

Ansible netscaler模块出现错误“;味精:&引用';非类型';对象没有属性';阅读'&引用;,ansible,netscaler,Ansible,Netscaler,有人尝试过使用Ansible(Ansible 1.9.4)Netscaler模块吗?我尝试使用它,但失败,出现错误: ansible localhost -m netscaler -a "nsc_host=nsc.example.com user=nscuser password=nscpassword name=node1.example.com type=service action=disable validate_certs=False" localhost | FAILED

有人尝试过使用Ansible(Ansible 1.9.4)Netscaler模块吗?我尝试使用它,但失败,出现错误:

ansible localhost  -m netscaler -a  "nsc_host=nsc.example.com  user=nscuser password=nscpassword  name=node1.example.com type=service action=disable validate_certs=False"


localhost | FAILED >> {
    "failed": true,
    "msg": "'NoneType' object has no attribute 'read'"
}
带-VV输出:

<localhost> REMOTE_MODULE netscaler nsc_host=nsc.example.com    user= nscuser     password=VALUE_HIDDEN name=node1.example.com type=service action=disable validate_certs=False
<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460868653.22-66856743808206 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460868653.22-66856743808206 && echo $HOME/.ansible/tmp/ansible-tmp-1460868653.22-66856743808206']
<localhost> PUT /tmp/tmpAfQPY2 TO /home/supp/.ansible/tmp/ansible-tmp-1460868653.22-66856743808206/netscaler
<localhost> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8    /usr/local/bin/python2.7 /home/supp/.ansible/tmp/ansible-tmp-1460868653.22- 66856743808206/netscaler; rm -rf /home/supp/.ansible/tmp/ansible-tmp- 1460868653.22-66856743808206/ >/dev/null 2>&1']
localhost | FAILED >> {
    "failed": true,
    "msg": "'NoneType' object has no attribute 'read'"
}
REMOTE\u MODULE netscaler nsc\u host=nsc.example.com user=nscuser password=VALUE\u HIDDEN name=node1.example.com type=service action=disable validate\u certs=False
EXEC['/bin/sh','-c','mkdir-p$HOME/.ansible/tmp/ansible-tmp-1460868353.22-66856743808206&&chmod a+rx$HOME/.ansible/tmp/ansible-tmp-14608686868353.22-668567808206&&echo$HOME/.ansible/tmp/ansible-tmp-14608686868353.22-668567808206']
将/tmp/tmpAfQPY2放入/home/supp/.ansible/tmp/ansible-tmp-14608653.22-66856743808206/netscaler
EXEC['/bin/sh','-c',u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8/usr/local/bin/python2.7/home/supp/.ansible/tmp/ansible-tmp-146086868686868353.22-66856743808206/netscaler;rm-rf/home/supp/.ansible/tmp/ansible-tmp-14608686868353.22-66856743808206/.1']
本地主机|失败>>{
“失败”:对,
“msg”:“'NoneType'对象没有'read'属性”
}
对于无法使用的1.9.5:

/usr/bin/ansible --version
ansible 1.9.5
  configured module search path = None


/usr/bin/ansible localhost -m netscaler -a  "nsc_host=nsc.example.com    user= nscuser     password=VALUE_HIDDEN name=node1.example.com type=service action=disable  validate_certs=False" -vvvv

<localhost> REMOTE_MODULE netscaler nsc_host=nsc.example.com    user= nscuser     password=VALUE_HIDDEN name=node1.example.com type=service action=disable validate_certs=False
<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620 && echo $HOME/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620']
<localhost> PUT /tmp/tmpiN_wRf TO /home/supp/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620/netscaler
<localhost> EXEC ['/bin/sh', '-c', u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8    /usr/bin/python26 /home/supp/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620/netscaler; rm -rf /home/supp/.ansible/tmp/ansible-tmp-1460873442.75-215681661318620/ >/dev/null 2>&1']
localhost | FAILED >> {
    "failed": true,
    "msg": "'NoneType' object has no attribute 'read'"
}
/usr/bin/ansible--版本
表1.9.5
配置的模块搜索路径=无
/usr/bin/ansible localhost-m netscaler-a“nsc\u host=nsc.example.com user=nscuser password=VALUE\u HIDDEN name=node1.example.com type=service action=disable validate\u certs=False”-vvv
远程\u模块netscaler nsc\u主机=nsc.example.com用户=nscuser密码=值\u隐藏名称=节点1.example.com类型=服务操作=禁用验证\u证书=错误
EXEC['/bin/sh','-c','mkdir-p$HOME/.ansible/tmp/ansible-tmp-1460873442.75-21568161318620和&chmod a+rx$HOME/.ansible/tmp/ansible-tmp-1460873442.75-21568161318620和echo$HOME/.ansible/tmp/ansible-tmp-1460873422.75-21568161318620']
将/tmp/tmpiN_wRf放入/home/supp/.ansible/tmp/ansible-tmp-1460873442.75-21568161318620/netscaler
EXEC['/bin/sh','-c',u'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8/usr/bin/python26/home/supp/.ansible/tmp/ansible-tmp-1460873442.75-21568161318620/netscaler;rm-rf/home/supp/.ansible/tmp/ansible-tmp-1460873422.75-21568161318620//dev/null 2>&1']
本地主机|失败>>{
“失败”:对,
“msg”:“'NoneType'对象没有'read'属性”
}
注意:localhost不是NETSCALER,它是一个管理主机

我还尝试在playbook中使用该模块,但仍然失败

希望听到你的建议


谢谢。

虽然错误信息不多,但问题是连接问题。 模块无法连接到netscaler。 检查您的网络连接并确保途中没有防火墙

根本原因在于

response, info = fetch_url(self.module, request_url, data=data_json, headers=headers)
return json.load(response)
“response”没有返回任何内容,if“None”类型也是如此,因此json.load无法读取None


添加
-vvvv
时的输出是什么?(编辑问题以包含输出)。@tedder42,问题中添加了带-vvv的输出,但我认为这没有帮助。“localhost”不是NETSCALER,只是一个管理主机。谢谢。你能更新到1.9.5或1.9.6吗?我有预感到一个错误修复。谢谢@tedder42,用“sudo pip install ANSIBLE--upgrade”将ANSIBLE升级到2.0.1.0,但仍然有相同的错误,所以我必须使用1.9.5或1.9.6?是的,使用1.9.5或1.9.6。我想是在95年。如果失败了,我们可以继续挖掘。