mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
dont mutate inventory vars
This commit is contained in:
@@ -92,7 +92,7 @@ class HostVars(dict):
|
|||||||
|
|
||||||
def __getitem__(self, host):
|
def __getitem__(self, host):
|
||||||
if host not in self.lookup:
|
if host not in self.lookup:
|
||||||
result = self.inventory.get_variables(host, vault_password=self.vault_password)
|
result = self.inventory.get_variables(host, vault_password=self.vault_password).copy()
|
||||||
result.update(self.vars_cache.get(host, {}))
|
result.update(self.vars_cache.get(host, {}))
|
||||||
self.lookup[host] = result
|
self.lookup[host] = result
|
||||||
return self.lookup[host]
|
return self.lookup[host]
|
||||||
|
|||||||
Reference in New Issue
Block a user