summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hokka Zakrisson <daniel@hozac.com>2012-11-25 01:00:14 +0100
committerDaniel Hokka Zakrisson <daniel@hozac.com>2012-11-25 01:00:14 +0100
commit5504f13c68f703fc4d67b1b1c5d3dfd58fe17cf2 (patch)
treec4bcce36bddd2bcef2daaa210e9b8ff6772f2445
parent4679d8d6e561dfc579293f1a80695fbf4f21b381 (diff)
downloadansible-5504f13c68f703fc4d67b1b1c5d3dfd58fe17cf2.tar.gz
Create groups in the first run through the file
Fixes #1208.
-rw-r--r--lib/ansible/inventory/ini.py2
1 files changed, 2 insertions, 0 deletions
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)