# skipping: no hosts matched

**URL:** <https://forum.ansible.com/t/skipping-no-hosts-matched/18171>\
**Category:** Ansible Project\
**Created:** [May 6, 2015, 4:27pm UTC](https://forum.ansible.com/t/skipping-no-hosts-matched/18171 "2015-05-06T16:27:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philipp\_Krenn](https://avatars.discourse-cdn.com/v4/letter/p/bc79bd/32.png) [@Philipp\_Krenn](https://forum.ansible.com/u/Philipp_Krenn)\
**Post date:** [May 6, 2015, 4:27pm UTC](https://forum.ansible.com/t/skipping-no-hosts-matched/18171/1 "2015-05-06T16:27:04Z")

</div>

ansible --version  
ansible 1.9.1  
configured module search path = None

I’ve started 2 EC2 instances with Ansible, which is working fine. I can also see their tag in the cache file:  
$ cat ~/.ansible/tmp/ansible-ec2.cache  
…  
“tag\_class\_dev\_nat”: [  
“52.28.23.161”,  
“52.28.92.82”  
],  
…

Now when I try to run a playbook with “- hosts: tag\_class\_dev\_nat”, no matching hosts can be found:  
$ ansible-playbook playbooks/1\_nat/1\_nat-install.yml -i env/dev/inventory

PLAY [tag\_class\_dev\_nat] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
skipping: no hosts matched

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

Any ideas why and how to fix this? I’m not even sure how I can debug this…

Thanks a lot,  
Philipp

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [July 21, 2015, 12:23pm UTC](https://forum.ansible.com/t/skipping-no-hosts-matched/18171/2 "2015-07-21T12:23:57Z")

</div>

How old is your cache? Do you also have AWS CLI installed? If so, are the credentials consistent with the boto credentials/env vars? Any customizations made to the ec2.ini file? Can you post the playbook? Can you add _–list-hosts_ to your command and post the output here? What about running _./env/dev/inventory/ec2.py --refresh-cache_ (assuming that’s where you have your python script)? It could be something with your inventory organizing. Can you share the structure?
