Updated documentation for PR http://github.com/ansible/ansible/pull/17207
This commit is contained in:
parent
00fbd98f97
commit
c9960c00dc
1 changed files with 47 additions and 5 deletions
|
@ -10,28 +10,47 @@
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
author: "Benno Joy (@bennojoy)"
|
author: "Allen Sanabria (@linuxdynasty)"
|
||||||
module: include_vars
|
module: include_vars
|
||||||
short_description: Load variables from files, dynamically within a task.
|
short_description: Load variables from files, dynamically within a task.
|
||||||
description:
|
description:
|
||||||
- Loads variables from a YAML/JSON file dynamically during task runtime. It can work with conditionals, or use host specific variables to determine the path name to load from.
|
- Loads variables from a YAML/JSON files dynamically from within a file or
|
||||||
|
from a directory recursively during task runtime. If loading a directory, the files are sorted alphabetically before being loaded.
|
||||||
options:
|
options:
|
||||||
file:
|
file:
|
||||||
version_added: "2.2"
|
version_added: "2.2"
|
||||||
description:
|
description:
|
||||||
- The file name from which variables should be loaded.
|
- The file name from which variables should be loaded.
|
||||||
- If the path is relative, it will look for the file in vars/ subdirectory of a role or relative to playbook.
|
- If the path is relative, it will look for the file in vars/ subdirectory of a role or relative to playbook.
|
||||||
|
dir:
|
||||||
|
version_added: "2.2"
|
||||||
|
description:
|
||||||
|
- The directory name from which the variables should be loaded.
|
||||||
|
- If the path is relative, it will look for the file in vars/ subdirectory of a role or relative to playbook.
|
||||||
|
default: null
|
||||||
name:
|
name:
|
||||||
version_added: "2.2"
|
version_added: "2.2"
|
||||||
description:
|
description:
|
||||||
- The name of a variable into which assign the included vars, if omitted (null) they will be made top level vars.
|
- The name of a variable into which assign the included vars, if omitted (null) they will be made top level vars.
|
||||||
default: null
|
default: null
|
||||||
|
depth:
|
||||||
|
version_added: "2.2"
|
||||||
|
description:
|
||||||
|
- By default, this module will recursively go through each sub directory and load up the variables. By explicitly setting the depth, this module will only go as deep as the depth.
|
||||||
|
default: 0
|
||||||
|
files_matching:
|
||||||
|
version_added: "2.2"
|
||||||
|
description:
|
||||||
|
- Limit the variables that are loaded within any directory to this regular expression.
|
||||||
|
default: null
|
||||||
|
ignore_files:
|
||||||
|
version_added: "2.2"
|
||||||
|
description:
|
||||||
|
- List of file names to ignore. The defaults can not be overridden, but can be extended.
|
||||||
|
default: null
|
||||||
free-form:
|
free-form:
|
||||||
description:
|
description:
|
||||||
- This module allows you to specify the 'file' option directly w/o any other options.
|
- This module allows you to specify the 'file' option directly w/o any other options.
|
||||||
notes:
|
|
||||||
- The file is always required either as the explicit option or using the free-form.
|
|
||||||
version_added: "1.4"
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
@ -54,4 +73,27 @@ EXAMPLES = """
|
||||||
# bare include (free-form)
|
# bare include (free-form)
|
||||||
- include_vars: myvars.yml
|
- include_vars: myvars.yml
|
||||||
|
|
||||||
|
# Include all yml files in vars/all and all nested directories
|
||||||
|
- include_vars:
|
||||||
|
dir: 'vars/all'
|
||||||
|
|
||||||
|
# Include all yml files in vars/all and all nested directories and save the output in test.
|
||||||
|
- include_vars:
|
||||||
|
dir: 'vars/all'
|
||||||
|
name: test
|
||||||
|
|
||||||
|
# Include all yml files in vars/services
|
||||||
|
- include_vars:
|
||||||
|
dir: 'vars/services'
|
||||||
|
depth: 1
|
||||||
|
|
||||||
|
# Include only bastion.yml files
|
||||||
|
- include_vars:
|
||||||
|
dir: 'vars'
|
||||||
|
files_matching: 'bastion.yml'
|
||||||
|
|
||||||
|
# Include only all yml files exception bastion.yml
|
||||||
|
- include_vars:
|
||||||
|
dir: 'vars'
|
||||||
|
ignore_files: 'bastion.yml'
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue