【发布时间】:2016-09-09 20:38:38
【问题描述】:
我正在尝试在多台服务器上运行 ansible 角色,但出现错误:
致命:[192.168.0.10]:无法访问! => {“改变”:假,“味精”: "通过 ssh 连接主机失败。", "unreachable": true}
我的 /etc/ansible/hosts 文件如下所示:
192.168.0.10 ansible_sudo_pass='passphrase' ansible_ssh_user=user
192.168.0.11 ansible_sudo_pass='passphrase' ansible_ssh_user=user
192.168.0.12 ansible_sudo_pass='passphrase' ansible_ssh_user=user
我不知道发生了什么 - 一切看起来都很好 - 我可以通过 SSH 登录,但 ansible ping 返回相同的错误。
详细执行的日志:
为用户建立 SSH 连接:用户 SSH:执行 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.0.10 '/bin/sh -c '"'"'( umask 22 && mkdir -p "
echo $HOME/.ansible/tmp/ansible-tmp-1463151813.31-156630225033829" && 回声“echo $HOME/.ansible/tmp/ansible-tmp-1463151813.31-156630225033829” )'"'"''
你能帮我吗?如果我必须在本地模式下使用ansible(-c local),那就没用了。
我尝试删除 ansible_sudo_pass 和 ansible_ssh_user,但没有帮助。
【问题讨论】:
标签: ssh connection ansible