mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Allow hostvars cache to be invalidated so hostvars contain all hosts after add_host
Fixes #12925
This commit is contained in:
parent
2825c188bd
commit
cace91df56
2 changed files with 11 additions and 2 deletions
|
@ -332,6 +332,11 @@ class VariableManager:
|
|||
debug("done with get_vars()")
|
||||
return all_vars
|
||||
|
||||
def invalidate_hostvars_cache(self, play):
|
||||
hostvars_cache_entry = self._get_cache_entry(play=play)
|
||||
if hostvars_cache_entry in HOSTVARS_CACHE:
|
||||
del HOSTVARS_CACHE[hostvars_cache_entry]
|
||||
|
||||
def _get_magic_variables(self, loader, play, host, task, include_hostvars, include_delegate_to):
|
||||
'''
|
||||
Returns a dictionary of so-called "magic" variables in Ansible,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue