From f25e4eea678b4d8afcfe70e92696dd6f551ab900 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 23 Mar 2016 13:39:05 -0700 Subject: [PATCH] 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 --- lib/ansible/inventory/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/inventory/__init__.py b/lib/ansible/inventory/__init__.py index 78e9f3c7932..428ba3295bc 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 = {}