Limit should not affect the calculation of host variables as the variables may be referenced by another host that is not limited.

Fixes #13556
Fixes #13557
Fixes #12174
This commit is contained in:
Toshio Kuratomi 2016-03-23 13:39:05 -07:00
parent 81c481739d
commit f25e4eea67

View file

@ -591,8 +591,13 @@ class Inventory(object):
for group in self.groups:
group.vars = utils.combine_vars(group.vars, self.get_group_vars(group, new_pb_basedir=True))
# get host vars from host_vars/ files
### HACK: in 2.0 subset isn't a problem. Never port this to 2.x
### Fixes: https://github.com/ansible/ansible/issues/13557
old_subset = self._subset
self._subset = None
for host in self.get_hosts():
host.vars = utils.combine_vars(host.vars, self.get_host_vars(host, new_pb_basedir=True))
self._subset = old_subset
# invalidate cache
self._vars_per_host = {}
self._vars_per_group = {}