Skip fact gathering if the entire play was included via conditional and False (#21734)

Addresses #21528
This commit is contained in:
jctanner 2017-02-21 14:46:10 -05:00 committed by GitHub
commit 40235d7b99
3 changed files with 11 additions and 0 deletions

View file

@ -184,6 +184,9 @@ class PlayIterator:
if fact_path:
setup_task.args['fact_path'] = fact_path
setup_task.set_loader(self._play._loader)
# short circuit fact gathering if the entire playbook is conditional
if self._play._included_conditional is not None:
setup_task.when = self._play._included_conditional[:]
setup_block.block = [setup_task]
setup_block = setup_block.filter_tagged_tasks(play_context, all_vars)