例外:无法导入pyOpenSSL

时间:2017-03-15 22:40:48

标签: python windows ansible pyopenssl winrm

我正在尝试使用一个ansible脚本来简单地从一个ansible控制服务器ping WINDOWS来宾,这是我的文件:

hosts.yml

[winsrvrs]
server.domain.com

**group_vars/all.yml**
ansible_user: domain\\userID
ansible_password: password
ansible_port: 5986
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore


When attempting to run ansible-playbook -i hosts play.yml i get the following error: 

Exception: Cannot import pyOpenSSL

fatal: [wstnm.nml.com]: FAILED! => {
    "failed": true,
    "msg": "Unexpected failure during module execution.",
    "stdout": ""
}

我尝试卸载并重新安装WINRM and PYOPENSSL以及所有支持的依赖项。

2 个答案:

答案 0 :(得分:0)

如果您的ansible控制机器在Ubuntu上,请首先安装这些依赖项:

$sudo apt-get install libffi-dev
$pip install cryptography

答案 1 :(得分:-1)

尝试pip install pyopenssl --upgrade