相关疑难解决方法(0)

ansible SSH连接失败

我试图在多个服务器上运行ansible角色,但是我收到一个错误:

致命:[192.168.0.10]:无法访问!=> {"已更改":false,"msg":"无法通过ssh连接到主机.","无法访问":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
Run Code Online (Sandbox Code Playgroud)

我不知道发生了什么 - 一切看起来很好 - 我可以通过SSH登录,但ansible ping返回相同的错误.

来自详细执行的日志:

<192.168.0.10>为用户建立SSH连接:user <192.168.0.10> SSH:EXEC 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" echo $HOME/.ansible/tmp/ansible-tmp-1463151813.31-156630225033829")''''''

你能以某种方式帮助我吗?如果我必须在本地模式(-c local)中使用ansible,那么它就没用了.

我试图删除ansible_sudo_pass和ansible_ssh_user,但它没有帮助.

connection ssh ansible

28
推荐指数
2
解决办法
7万
查看次数

标签 统计

ansible ×1

connection ×1

ssh ×1