diff --git a/lib/ansible/inventory/manager.py b/lib/ansible/inventory/manager.py index c08e4b8c19..dc3f57da44 100644 --- a/lib/ansible/inventory/manager.py +++ b/lib/ansible/inventory/manager.py @@ -608,7 +608,7 @@ class InventoryManager(object): for x in subset_patterns: if x.startswith("@"): fd = open(x[1:]) - results.extend(fd.read().split("\n")) + results.extend([l.strip() for l in fd.read().split("\n")]) fd.close() else: results.append(x)