Fix for issue #2916 : for each host promote the host variables as globally scoped variables for the sake of the groups determination

This commit is contained in:
Stoned Elipot 2013-05-16 18:57:05 +02:00
parent c0f138db1f
commit 94ba0f740a

View file

@ -55,9 +55,12 @@ class ActionModule(object):
groups = {}
for host in self.runner.host_set:
if not check_conditional(template.template(self.runner.basedir, self.runner.conditional, inject)):
data = {}
data.update(inject)
data.update(inject['hostvars'][host])
if not check_conditional(template.template(self.runner.basedir, self.runner.conditional, data)):
continue
group_name = template.template(self.runner.basedir, args['key'], inject)
group_name = template.template(self.runner.basedir, args['key'], data)
group_name = group_name.replace(' ','-')
if group_name not in groups:
groups[group_name] = []