1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Invalidate host/group variables cache when loading

extra varsiables based on playbook basedir.
This commit is contained in:
Serge van Ginderachter 2014-07-14 15:21:33 +02:00
parent d39ff55688
commit e8b45a9ef7

View file

@ -582,6 +582,9 @@ class Inventory(object):
# get host vars from host_vars/ files # get host vars from host_vars/ files
for host in self.get_hosts(): for host in self.get_hosts():
host.vars = utils.combine_vars(host.vars, self.get_host_vars(host, new_pb_basedir=True)) host.vars = utils.combine_vars(host.vars, self.get_host_vars(host, new_pb_basedir=True))
# invalidate cache
self._vars_per_host = {}
self._vars_per_group = {}
def get_host_vars(self, host, new_pb_basedir=False): def get_host_vars(self, host, new_pb_basedir=False):
""" Read host_vars/ files """ """ Read host_vars/ files """