Fix gathering facts in run_once play (#39453)

* Fix gathering facts in run_once play

Fixes https://github.com/ansible/ansible/issues/39312

* Check that run_once doesn't prevent fact gathering
This commit is contained in:
Mickaël Guérin 2018-05-04 21:33:32 +02:00 committed by Brian Coca
commit 8ac69b0a5f
4 changed files with 43 additions and 0 deletions

View file

@ -169,6 +169,9 @@ class PlayIterator:
fact_path = self._play.fact_path
setup_block = Block(play=self._play)
# Gathering facts with run_once would copy the facts from one host to
# the others.
setup_block.run_once = False
setup_task = Task(block=setup_block)
setup_task.action = 'setup'
setup_task.name = 'Gathering Facts'