From 75100201a243b9a869f5498914b93a79c8248e3e Mon Sep 17 00:00:00 2001 From: Stoned Elipot Date: Fri, 10 May 2013 00:02:14 +0200 Subject: [PATCH] Allow globally scoped variables with group_by module's conditionals and key argument --- lib/ansible/runner/action_plugins/group_by.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/runner/action_plugins/group_by.py b/lib/ansible/runner/action_plugins/group_by.py index bd510c0f1c..d6f5bd727a 100644 --- a/lib/ansible/runner/action_plugins/group_by.py +++ b/lib/ansible/runner/action_plugins/group_by.py @@ -54,10 +54,9 @@ class ActionModule(object): ### find all groups groups = {} for host in self.runner.host_set: - data = inject['hostvars'][host] - if not check_conditional(template.template(self.runner.basedir, self.runner.conditional, data)): + if not check_conditional(template.template(self.runner.basedir, self.runner.conditional, inject)): continue - group_name = template.template(self.runner.basedir, args['key'], data) + group_name = template.template(self.runner.basedir, args['key'], inject) group_name = group_name.replace(' ','-') if group_name not in groups: groups[group_name] = []