Provide the list of files that were included by include_vars

include_vars will now also return a key 'ansible_included_var_files'
which contains the list of files that were successfully loaded.
This is useful information and, amongst other things, a way for users
to know exactly what files were included when debugging their
playbooks.
This also allows us to improve the integration tests around
include_vars.
This commit is contained in:
David Moreau-Simard 2017-05-13 07:28:41 -04:00 committed by Brian Coca
commit 9fdd07fba8
3 changed files with 40 additions and 7 deletions

View file

@ -120,3 +120,17 @@ EXAMPLES = """
ignore_files: 'bastion.yml'
extensions: ['yml']
"""
RETURN = '''
ansible_facts:
description: Variables that were included and their values
returned: success
type: dict
sample: {'variable': 'value'}
ansible_included_var_files:
description: A list of files that were successfully included
returned: success
type: list
sample: [ '/path/to/file.yml', '/path/to/file.json' ]
version_added: 2.4
'''