mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Allow globally scoped variables with group_by module's conditionals and key argument
This commit is contained in:
parent
8ef18c2f98
commit
75100201a2
1 changed files with 2 additions and 3 deletions
|
@ -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] = []
|
||||
|
|
Loading…
Reference in a new issue