diff --git a/lib/ansible/inventory/ini.py b/lib/ansible/inventory/ini.py index fafe0b5023..ddf1ba9534 100644 --- a/lib/ansible/inventory/ini.py +++ b/lib/ansible/inventory/ini.py @@ -66,6 +66,8 @@ class InventoryParser(object): if line.startswith("["): active_group_name = line.replace("[","").replace("]","").strip() if line.find(":vars") != -1 or line.find(":children") != -1: + active_group_name = active_group_name.rsplit(":", 1)[0] + self.groups[active_group_name] = Group(name=active_group_name) active_group_name = None else: new_group = self.groups[active_group_name] = Group(name=active_group_name)