Using ansible_ssh_private_key_file variable vs --private-key

3,543 views
Skip to first unread message

Stuart Reynolds

unread,
May 6, 2014, 9:22:13 PM5/6/14
to ansible...@googlegroups.com
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

Stuart Reynolds

unread,
Jun 25, 2014, 2:21:24 PM6/25/14
to ansible...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages