Random SSH connection reset during EC2 provisionning

Hi,

I use Ansible to provision Ubuntu 14.04 machines. Some machines are at a dedicated provider’s, some are EC2 instances. Provisionning works great for the first ones, but sometimes fails with EC2 VMs. The failure is typically an SSH disconnection. Error messages usually indicate “Connection closed by peer” or similar depending on the log level and the step where it fails. They happen randomly during the provisioning which takes about 15 minutes. If I re-provision, it may succeed.

I guess this is not Ansible’s fault, but I was wondering if someone had the same experience. I’m using a vanilla Ubuntu AMI and haven’t tweaked the SSH settings at all.

Thanks,
Warren.

I’ve run into similar issues, provisioning to RHEL servers from Ubuntu. Either SSH connection refused, terminated, reset, etc. I’ve even tried uploading my ubuntu VM to ESXi, and get the same thing there. I’m backing down to 1.8.4 of Ansible to see if it still occurs, I don’t think I ran into these issues until the package was upgraded.

I’m using Ansible 1.8.3, from OS X to Ubuntu 14.04.

I ended up using Ansible locally on the EC2 machine. Not only it works all the time, but it’s also about 10x faster.