SSH encountered an unknown error (Broken Pipe)

December 26, 2015

I just setup a Babun environment on my Windows 10 workstation and installed vagrant&ansible.
While testing my complete setup I got an error while using multiple vagrant vms in an ansible playbook or ansible command.

The reason for this is that ansible as a default overrides the SSH connection to use the following options:-o ControlMaster=auto -o ControlPersist=60s -o ControlPath=”/home/devel/.ansible/cp/ansible-ssh-%h-%p-%r”

In a vagrant setup you do usually a port forwarding for SSH. In my case I forwarded from TCP 2222, 2200 and 2201 to TCP 22 on the specific vagrant VM. The OpenSSH ControlMaster functionality in conjunction with port forwarding is a bad idea. So I had to prevent ansible using SSH ControlMaster with the following parameters in my ansible.cfg: