2017-03-15 79 views
0

我試圖得到一個ansible腳本從ansible控制服務器的工作簡單地坪WINDOWS的客人,這裏是我的文件:例外:無法導入pyOpenSSL

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以及所有支持的依賴項。

回答

-1

嘗試pip install pyopenssl --upgrade

+0

曾爲...這是一個令人難以置信的令人沮喪的情況,感謝爲我提供的答案! –

+0

以及如果模塊已安裝? – J00MZ

0

如果您ansible控制機是在Ubuntu上,先安裝這些依賴關係:

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