Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue #2916 : for each host promote the host variables as global... #2944

Merged
merged 1 commit into from
May 16, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/ansible/runner/action_plugins/group_by.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def run(self, conn, tmp, module_name, module_args, inject, complex_args=None, **
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] = []
Expand Down