mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #2944 from stoned/fix-2916
Fix for issue #2916 : for each host promote the host variables as global...
This commit is contained in:
commit
2684066aa1
1 changed files with 5 additions and 2 deletions
|
@ -55,9 +55,12 @@ class ActionModule(object):
|
||||||
groups = {}
|
groups = {}
|
||||||
|
|
||||||
for host in self.runner.host_set:
|
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
|
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(' ','-')
|
group_name = group_name.replace(' ','-')
|
||||||
if group_name not in groups:
|
if group_name not in groups:
|
||||||
groups[group_name] = []
|
groups[group_name] = []
|
||||||
|
|
Loading…
Reference in a new issue