This error occurs because Ansible uses by default very long names for ControlPath sockets he creates for internal usage.
Fortunately, there is a straightforward solution, as described in official documentation.
Put the following file into the directory where you run Ansible and give it a name 'ansible.cfg':
# Avoid Ansible error on the AWS: too long for Unix domain socket
Now you're able to deploy using Ansible to Amazon AWS and avoid "name is too long for Unix domain socket" error.