Configurable list of facts modules (#31783)

* configurable list of facts modules

 - allow for args dict for specific modules
 - add way to pass parameters
 - avoid facts poluting test
 - move to 'facts gathered' flag
 - add 'gathering' setting tests
This commit is contained in:
Brian Coca 2018-05-11 13:59:54 -04:00 committed by GitHub
commit 95655fae5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 173 additions and 3 deletions

View file

@ -173,7 +173,7 @@ class PlayIterator:
# the others.
setup_block.run_once = False
setup_task = Task(block=setup_block)
setup_task.action = 'setup'
setup_task.action = 'gather_facts'
setup_task.name = 'Gathering Facts'
setup_task.tags = ['always']
setup_task.args = {
@ -301,7 +301,7 @@ class PlayIterator:
if (gathering == 'implicit' and implied) or \
(gathering == 'explicit' and boolean(self._play.gather_facts, strict=False)) or \
(gathering == 'smart' and implied and not (self._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('_ansible_facts_gathered', 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]