mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
host.get_variables includes too many variables, use host.vars instead
Not quite as attractive, but allows variable precedence and lazy resolution to work as intended, rather than resolving them on a per-inventory basis.
This commit is contained in:
parent
8f917a5a9f
commit
2ff2f05a0f
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ class InventoryDirectory(object):
|
||||||
for host in group.get_hosts():
|
for host in group.get_hosts():
|
||||||
if host.name not in self.hosts:
|
if host.name not in self.hosts:
|
||||||
self.hosts[host.name] = Host(host.name)
|
self.hosts[host.name] = Host(host.name)
|
||||||
for k, v in host.get_variables().iteritems():
|
for k, v in host.vars.iteritems():
|
||||||
self.hosts[host.name].set_variable(k, v)
|
self.hosts[host.name].set_variable(k, v)
|
||||||
self.groups[name].add_host(self.hosts[host.name])
|
self.groups[name].add_host(self.hosts[host.name])
|
||||||
# This needs to be a second loop to ensure all the parent groups exist
|
# This needs to be a second loop to ensure all the parent groups exist
|
||||||
|
|
Loading…
Reference in a new issue