skipping: no hosts matched

1,087 views
Skip to first unread message

Philipp Krenn

unread,
May 6, 2015, 12:27:41 PM5/6/15
to ansible...@googlegroups.com

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

Dan Vaida

unread,
Jul 21, 2015, 8:23:57 AM7/21/15
to ansible...@googlegroups.com
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?
Reply all
Reply to author
Forward
0 new messages