Ansible cannot find hosts defined in ~/.ssh/config

38 views
Skip to first unread message

Aleksey Kislov

unread,
Jul 10, 2015, 9:33:55 AM7/10/15
to ansible...@googlegroups.com

After recent update, when I try to run my playbook, I immediately get the skipping: no hosts matched response. I can reproduce it with following command:

ansible myhost --list-hosts 

The output of it is No hosts matchedmyhost is defined in my local ssh config. -c ssh has the same effect. When I downgrade to 1.7.2 it works fine (ansible locates myhost). /etc/ansible/ansible.cfg has defaults in [ssh_connection] section.

My system is Ubuntu 15.04. Ssh version is OpenSSH_6.7p1 Ubuntu-5ubuntu1, OpenSSL 1.0.1f 6 Jan 2014. Current Ansible version is 1.9.2.

Paul Markham

unread,
Jul 19, 2015, 12:38:02 AM7/19/15
to ansible...@googlegroups.com
I don't think Ansible is going to look in you .ssh/config for hosts. Instead it'll look in its inventory, which is probably under /etc/ansible by default. Perhaps upgrading Ansible re-wrote the inventory file and lost you configuration.
Reply all
Reply to author
Forward
0 new messages