Using ansible_ssh_private_key_file variable vs --private-key

I can call:

ansible all -m ping -i DevHosts --user=ubuntu --private-key=../DevMongo.pem

with DevHosts:

[mongo] 1.2.3.4

and ansible will correctly connect to the host. But if I try and store these parameters in an inventory: (as suggested here )

`
[mongo]
1.2.3.4 ansible_ssh_user=ubuntu ansible_ssh_private_key_file=…/DevMongo.pem

`

ansible all -m ping -i DevHosts

… gives me: 1.2.3.4 | FAILED => FAILED: No authentication methods available.

Are --private-key and ansible_ssh_private_key_file related? What am I missing here?

Cheers

  • Stuart

Seems like feature was fixed/added between v0.9 and 1.7. (0.9 is what apt-get still provides for Ubunutu 12.04 LTS). Switching to the git version solved this.

  • Stuart