From 30fec68931a44ce57a28a674a9736c5d22381f60 Mon Sep 17 00:00:00 2001 From: Will Thames Date: Thu, 25 May 2017 11:10:47 +1000 Subject: [PATCH] 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 --- lib/ansible/executor/play_iterator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py index 4cce30e500..b70c183528 100644 --- a/lib/ansible/executor/play_iterator.py +++ b/lib/ansible/executor/play_iterator.py @@ -150,6 +150,7 @@ class PlayIterator: def __init__(self, inventory, play, play_context, variable_manager, all_vars, start_at_done=False): self._play = play self._blocks = [] + self._variable_manager = variable_manager self._task_uuid_cache = dict() @@ -303,7 +304,7 @@ class PlayIterator: if (gathering == 'implicit' and implied) 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 # during the play compilation in __init__ above. setup_block = self._blocks[0]