fatal: [ec2-x.x.x.x.us-west-2.compute.amazonaws.com] => SSH Error: unix_listener: "/home/shrinivasan/.ansible/cp/ansible-ssh-x.x.x.x.us-west-2.compute.amazonaws.com-22-ubuntu.0wqQt0HttbVPpz9B" too long for Unix domain socket
while connecting to x.x.x.x:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
I got the above error on ansible, when used huge hostnames ( amazon ec2 names) instead of IP addresses, in hosts file for ansible.
Ansible can not log in the the machines via ssh.
To solve this, in /etc/ansible/ansible.cfg file, enable the following.
control_path = %(directory)s/%%h-%%r
After this, ansible can login to remote servers and run the scripts.