summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2016-03-23 13:39:05 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2016-03-23 13:40:09 -0700
commitf25e4eea678b4d8afcfe70e92696dd6f551ab900 (patch)
treec895f40666fb7adfa8f9bbf49b74519d43610de3
parent81c481739dc4fbfce7b01047d9ad3ec4dffcc8f5 (diff)
downloadansible-f25e4eea678b4d8afcfe70e92696dd6f551ab900.tar.gz
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
-rw-r--r--lib/ansible/inventory/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py
index 78e9f3c793..428ba3295b 100644
--- a/lib/ansible/inventory/__init__.py
+++ b/lib/ansible/inventory/__init__.py
@@ -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 = {}