mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
fix for dynamic (add_host) hosts not available in hostvars
Looks like there are two pattern caches that need to be cleared for this to work- added the second one. Added integration tests for add_host to prevent future regressions.
This commit is contained in:
@@ -455,6 +455,8 @@ class Inventory(object):
|
||||
|
||||
def clear_pattern_cache(self):
|
||||
''' called exclusively by the add_host plugin to allow patterns to be recalculated '''
|
||||
global HOSTS_PATTERNS_CACHE
|
||||
HOSTS_PATTERNS_CACHE = {}
|
||||
self._pattern_cache = {}
|
||||
|
||||
def groups_for_host(self, host):
|
||||
|
||||
Reference in New Issue
Block a user