小编Ati*_*tik的帖子

Ansible 无法与 SSH 连接(横幅交换)

如果问题不清楚和/或如果我没有问我应该在哪里,请提前抱歉。

我在通过 SSH 连接到带有 ansible 的主机时遇到问题。几天前它起作用了,但几天来我一直有相同的消息错误:

        camille@ubuntu:~$ ansible all  -m ping -u remote
192.xxx.xxx.xxx | UNREACHABLE! => {
        "changed": false, 
        "msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n", 
        "unreachable": true
    }
Run Code Online (Sandbox Code Playgroud)

SSH 连接(没有ansible)运行良好,所以我不太明白这个问题。我在 Ubuntu 16.04 VM 上运行 Ansible,我想访问的主机是 CentOS 7 VM。

我的主机文件如下:

[test]    
192.xxx.xxx.xxx ansible_ssh_user=remote ansible_ssh_pass=password ansible_sudo_pass='password' #VM CentOS
Run Code Online (Sandbox Code Playgroud)

我尝试了此处解释的解决方案但没有解决问题。

编辑 1:在尝试 Ripper Tops 解决方案并测试其他一些东西后,我的库存现在看起来像这样:

[test]
192.xxx.xxx.xxx ansible_connection=ssh ansible_user=remote ansible_password='password'

[test:vars]
proxy=my_proxy:8080
Run Code Online (Sandbox Code Playgroud)

我也尝试将超时增加到 25,但我仍然遇到同样的问题。

编辑2

更改我的 ansible.cfg …

ssh ansible

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

标签 统计

ansible ×1

ssh ×1