当我尝试做任何事情时,即使是在 cygwin 下使用 ansible 进行一些基本操作,也会出现以下错误:
$ ansible all -m ping
example.org | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: mm_send_fd: sendmsg(2): Connection reset by peer\r\nmux_client_request_session: send fds failed\r\n",
"unreachable": true
}
答案1
将以下行添加到ansible.cfg
(在剧本文件夹或中/etc/ansible/ansible.cfg
):
[ssh_connection]
ssh_args = -o ControlMaster=no
据我所知,这ControlMaster=auto
也是可行的,但在 cygwin 下必须禁用此选项。来源。