我让流浪汉virtual machine
正在运行。
我可以使用ssh
ssh vagrant@192.168.0.28
进入它,然后它会问我私钥的密码短语,我可以输入,然后它会将我登录。
但如果我使用:
ansible all -m ping
然后我明白了:
192.168.0.28 | FAILED => FAILED: ssh moor@192.168.0.28:22 : Private key file is encrypted
To connect as a different user, use -u <username>.
如何在ansible中输入密码?
我尝试ansible -k
,但它说身份验证失败。
答案 0 :(得分:8)
尝试使用ssh
作为传输。通常,Ansible使用的paramiko
对交互式会话不友好:
ansible all -c ssh -m ping
如果这不起作用,我在文档或代码中使用ssh密钥密码短语运行Ansible时没有看到任何内容,因此您可能必须使用以下内容删除它:
openssl rsa -in private_key_with_pass_phrase -out private_key_without_pass_phrase