Ansible 2.3 error during ssh connection to host is one of the common error faced by most of the new users of ansible. The error looks like the below statement.

infra_ci | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: packet_write_wait: Connection to Broken pipe\r\nmux_client_request_session: read from master failed: Broken pipe\r\nFailed to connect to new control master\r\n",
    "unreachable": true

Check your Ansible version

> ansible --version
  config file =
  configured module search path = Default w/o overrides
  python version = 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]

You can fix this problem by make the following changes.

  • Add args of-c paramiko and remove the openssh-client on Ansible 2.3 and Alpine Linux 3.4.6.
  • else, add the change in your ansible.cfg file. Refer the following link.