ansible/ansible — pull request #3895 by mscherer (2013-08-20 20:05:25+00:00)
Title: make sure ssh do not ask password

For some reason, ssh seems to ask for password even when
PasswordAuthentication is set to no, adding PreferredAuthentications
with the 2 options removed do the trick.

To verify that, just take a server where you do not have ssh key:

ssh -v -o 'KbdInteractiveAuthentication=no' '-o' 'PasswordAuthentication=no' '-o' 'PreferredAuthentications=hostbased,publickey' test.example.org

=> no password asked

ssh -v -o 'KbdInteractiveAuthentication=no' '-o' 'PasswordAuthentication=no' test.example.org
=> ask password

Tested from a F19 and RHEL 6 to a Centos 6 server.