有没有人尝试使用 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'"
}
使用 -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-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'"
}
无法使用的 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'"
}
注意:localhost 不是 NETSCALER,它是一个管理主机。
我也尝试在剧本中使用该模块但仍然失败。
希望听到你的建议。
谢谢。