From c0baf1084570649f8eb025c5a345e7419c25a957 Mon Sep 17 00:00:00 2001 From: Darryl Stoflet Date: Sun, 2 Jun 2013 14:54:29 -0700 Subject: [PATCH] Support for all:vars in script inventories --- lib/ansible/inventory/script.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/inventory/script.py b/lib/ansible/inventory/script.py index 49afef40c7..915aaa1803 100644 --- a/lib/ansible/inventory/script.py +++ b/lib/ansible/inventory/script.py @@ -76,8 +76,12 @@ class InventoryScript(object): if 'vars' in data: for k, v in data['vars'].iteritems(): - group.set_variable(k, v) - all.add_child_group(group) + if group.name == all.name: + all.set_variable(k, v) + else: + group.set_variable(k, v) + if group.name != all.name: + all.add_child_group(group) # Separate loop to ensure all groups are defined for (group_name, data) in self.raw.items():