# Ansible Bug: skipping no hosts matched

**URL:** <https://forum.ansible.com/t/ansible-bug-skipping-no-hosts-matched/25657>\
**Category:** Ansible Project\
**Created:** [October 2, 2017, 3:10pm UTC](https://forum.ansible.com/t/ansible-bug-skipping-no-hosts-matched/25657 "2017-10-02T15:10:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colm\_Mcnabola](https://avatars.discourse-cdn.com/v4/letter/c/41988e/32.png) [@Colm\_Mcnabola](https://forum.ansible.com/u/Colm_Mcnabola)\
**Post date:** [October 2, 2017, 3:10pm UTC](https://forum.ansible.com/t/ansible-bug-skipping-no-hosts-matched/25657/1 "2017-10-02T15:10:52Z")

</div>

Hi All

I am having an issue with ansbible. I have created an inventory folder and declared a hostgroup for different nodes

for example, in inventory file  
[NodeGroup1]  
node1@node.node

[NodeGroup2]  
node2@node.node  
node3@node.node

This inventory is stored under /environment/testEnv

When running a playbook using --extra vars and declaring the name of the host group like so  
ansible-playbook deploy\_rpm.yml -i environment/testEnv --extra-vars=‘{“hostgroup”: “NodeGroup1”, “var1”: “test-rpm”, “version”: “0.1”}’

When i run it, it passes and deploys the rpm.  
When the hostgroup is named wrong, ‘NodeGroup999’ for example.  
ansible-playbook deploy\_rpm.yml -i environment/testEnv --extra-vars=‘{“hostgroup”: “NodeGroup999”, “var1”: “test-rpm”, “version”: “0.1”}’

It will just PLAY RECAP and silently fail.  
I want to ansible to fail completely if this happens but cant see anything online and cant put in any debug as it doesnt actually run a task.

From what i can see its more of an bug with ansible than the playbook i have created.

Any ideas?

Thanks
