From 87ca4757049ff47621d5a9b9d7641be1ed9b178b Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 17 Jun 2015 16:25:58 -0400 Subject: [PATCH] Exclude the all/ungrouped groups from pattern matching results Fixes #5375 --- lib/ansible/inventory/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index de25c2ac32..26e9e61787 100644 --- a/lib/ansible/inventory/__init__.py +++ b/lib/ansible/inventory/__init__.py @@ -364,7 +364,7 @@ class Inventory(object): for host in group.get_hosts(): __append_host_to_results(host) else: - if self._match(group.name, pattern): + if self._match(group.name, pattern) and group.name not in ('all', 'ungrouped'): for host in group.get_hosts(): __append_host_to_results(host) else: