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

Expose variable_manager to PlayIterator

`variable_manager` is passed to the constructor of `PlayIterator`,
and then used to access the fact cache when fact gathering.
Make `_variable_manager` an attribute of the `PlayIterator` class
This commit is contained in:
Will Thames 2017-05-25 11:10:47 +10:00 committed by Brian Coca
parent 8e1e896955
commit 30fec68931

View file

@ -150,6 +150,7 @@ class PlayIterator:
def __init__(self, inventory, play, play_context, variable_manager, all_vars, start_at_done=False): def __init__(self, inventory, play, play_context, variable_manager, all_vars, start_at_done=False):
self._play = play self._play = play
self._blocks = [] self._blocks = []
self._variable_manager = variable_manager
self._task_uuid_cache = dict() self._task_uuid_cache = dict()
@ -303,7 +304,7 @@ class PlayIterator:
if (gathering == 'implicit' and implied) or \ if (gathering == 'implicit' and implied) or \
(gathering == 'explicit' and boolean(self._play.gather_facts)) or \ (gathering == 'explicit' and boolean(self._play.gather_facts)) or \
(gathering == 'smart' and implied and not (variable_manager._fact_cache.get(host.name,{}).get('module_setup', False))): (gathering == 'smart' and implied and not (self._variable_manager._fact_cache.get(host.name,{}).get('module_setup', False))):
# The setup block is always self._blocks[0], as we inject it # The setup block is always self._blocks[0], as we inject it
# during the play compilation in __init__ above. # during the play compilation in __init__ above.
setup_block = self._blocks[0] setup_block = self._blocks[0]