Ansible Bug: skipping no hosts matched

25 views
Skip to first unread message

Colm Mcnabola

unread,
Oct 2, 2017, 11:10:53 AM10/2/17
to Ansible Project
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]
no...@node.node

[NodeGroup2]
no...@node.node
no...@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
Reply all
Reply to author
Forward
0 new messages