Error: "skipping: no hosts matched"
There can be multiple reasons this happens, so we’ll step through all of them. We’ll start by assuming you’re running the command
ansible-playbook galaxy.yml
The following things can cause issues:
- Within your
galaxy.yml
, you’ve referred to a host group that doesn’t exist or is misspelled. Check thehosts: galaxyservers
to ensure it matches the host group defined in thehosts
file. - Vice-versa, the group in your
hosts
file should match the hosts selected in the playbook,galaxy.yml
. - If neither of these are the issue, it’s possible Ansible doesn’t know to check the
hosts
file for the inventory. Make sure you’ve specifiedinventory = hosts
in youransible.cfg
.
Still have questions?
Gitter Chat Support
Galaxy Help Forum
Want to embed this snippet (FAQ) in your GTN Tutorial?
{% snippet topics/admin/faqs/ansible_error-no-hosts-matched.md %}