[WARNING]: provided hosts list is empty, only localhost is available

9,056 views
Skip to first unread message

Leroy Walker Jr

unread,
Mar 22, 2016, 11:06:10 AM3/22/16
to Ansible Project
I could really use some help on this issue. I have a hosts file with one server.
the hosts looks like

[vm]
172.20.20.106

when i run the host command, i get:

 ansible -i hosts --list-hosts all
 hosts (1):
 172.20.20.106

but when i run a simple ping command  
ansible hosts -m ping
 [WARNING]: provided hosts list is empty, only localhost is available

I get the following

I have not idea whats wrong! 

Dick Davies

unread,
Mar 22, 2016, 12:02:18 PM3/22/16
to ansible list
You need a group as the second argument. try

ansible -i hosts vm -m ping
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3c0373b0-2259-4023-9eb5-c9c02735ba0a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Uditha Desilva

unread,
Mar 22, 2016, 12:20:41 PM3/22/16
to Ansible Project
You didn't specify the inventory in the 2nd command... try

ansible -i hosts -m ping all

Leroy Walker Jr

unread,
Mar 22, 2016, 1:26:01 PM3/22/16
to Ansible Project
DOH!!!! thanks so much! that worked. 
Reply all
Reply to author
Forward
0 new messages