summaryrefslogtreecommitdiff
path: root/lib/ansible/modules/utilities/logic/include_vars.py
diff options
context:
space:
mode:
authorJiri Tyr <jtyr@users.noreply.github.com>2017-11-22 22:05:29 +0000
committerscottb <dharmabumstead@users.noreply.github.com>2017-11-22 14:05:29 -0800
commit283fee90a796659755531b4c6b316622e652378f (patch)
tree9adf897057b714c4178a1511d577f7d45d0653e5 /lib/ansible/modules/utilities/logic/include_vars.py
parent496ce388ab4dc464b9b3f821e05b98ebfc7fb17f (diff)
downloadansible-283fee90a796659755531b4c6b316622e652378f.tar.gz
Unifying wording and formatting of all include and import modules (#31938)
* Unifying wording and formatting of all include and import modules * Changes based on comments from dharmabumstead * Removed instances of the term ‘Ansible Engine’ * Removed instances of term ‘Ansible Engine’ * Updated term * Updated wording * Updated wording * Removed the term ‘Ansible Engine’
Diffstat (limited to 'lib/ansible/modules/utilities/logic/include_vars.py')
-rw-r--r--lib/ansible/modules/utilities/logic/include_vars.py74
1 files changed, 38 insertions, 36 deletions
diff --git a/lib/ansible/modules/utilities/logic/include_vars.py b/lib/ansible/modules/utilities/logic/include_vars.py
index e82e76e2b6..921ca1e8e5 100644
--- a/lib/ansible/modules/utilities/logic/include_vars.py
+++ b/lib/ansible/modules/utilities/logic/include_vars.py
@@ -5,27 +5,29 @@ from __future__ import absolute_import, division, print_function
__metaclass__ = type
-ANSIBLE_METADATA = {'metadata_version': '1.1',
- 'status': ['stableinterface'],
- 'supported_by': 'core'}
+ANSIBLE_METADATA = {
+ 'metadata_version': '1.1',
+ 'status': ['stableinterface'],
+ 'supported_by': 'core'
+}
DOCUMENTATION = '''
---
-author: "Allen Sanabria (@linuxdynasty)"
+author: Allen Sanabria (@linuxdynasty)
module: include_vars
-short_description: Load variables from files, dynamically within a task.
+short_description: Load variables from files, dynamically within a task
description:
- - 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.
- - This module is also supported for Windows targets.
+ - 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.
+ - This module is also supported for Windows targets.
version_added: "1.4"
options:
file:
version_added: "2.2"
description:
- - 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.
+ - 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.
dir:
version_added: "2.2"
description:
@@ -35,13 +37,13 @@ options:
name:
version_added: "2.2"
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
depth:
version_added: "2.2"
description:
- - When using C(dir), this module will, by default, 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.
+ - When using C(dir), this module will, by default, 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"
@@ -57,65 +59,65 @@ options:
version_added: "2.3"
description:
- List of file extensions to read when using C(dir).
- default: ['yaml', 'yml', 'json']
+ default: [yaml, yml, json]
required: False
free-form:
description:
- - This module allows you to specify the 'file' option directly w/o any other options.
- There is no 'free-form' option, this is just an indicator, see example below.
+ - This module allows you to specify the 'file' option directly without any other options.
+ There is no 'free-form' option, this is just an indicator, see example below.
notes:
- - This module is also supported for Windows targets.
+ - This module is also supported for Windows targets.
'''
EXAMPLES = """
-- name: Include vars of stuff.yml into the 'stuff' variable (2.2).
+- name: Include vars of stuff.yaml into the 'stuff' variable (2.2).
include_vars:
- file: stuff.yml
+ file: stuff.yaml
name: stuff
- name: Conditionally decide to load in variables into 'plans' when x is 0, otherwise do not. (2.2)
include_vars:
- file: contingency_plan.yml
+ file: contingency_plan.yaml
name: plans
when: x == 0
- name: Load a variable file based on the OS type, or a default if not found. Using free-form to specify the file.
include_vars: "{{ item }}"
with_first_found:
- - "{{ ansible_distribution }}.yml"
- - "{{ ansible_os_family }}.yml"
- - "default.yml"
+ - "{{ ansible_distribution }}.yaml"
+ - "{{ ansible_os_family }}.yaml"
+ - default.yaml
-- name: bare include (free-form)
- include_vars: myvars.yml
+- name: Bare include (free-form)
+ include_vars: myvars.yaml
- name: Include all .json and .jsn files in vars/all and all nested directories (2.3)
include_vars:
- dir: 'vars/all'
+ dir: vars/all
extensions:
- json
- jsn
- name: Include all default extension files in vars/all and all nested directories and save the output in test. (2.2)
include_vars:
- dir: 'vars/all'
+ dir: vars/all
name: test
- name: Include default extension files in vars/services (2.2)
include_vars:
- dir: 'vars/services'
+ dir: vars/services
depth: 1
-- name: Include only files matching bastion.yml (2.2)
+- name: Include only files matching bastion.yaml (2.2)
include_vars:
- dir: 'vars'
- files_matching: 'bastion.yml'
+ dir: vars
+ files_matching: bastion.yaml
-- name: Include all .yml files except bastion.yml (2.3)
+- name: Include all .yaml files except bastion.yaml (2.3)
include_vars:
- dir: 'vars'
- ignore_files: 'bastion.yml'
- extensions: ['yml']
+ dir: vars
+ ignore_files: bastion.yaml
+ extensions: [yaml]
"""
RETURN = '''
@@ -128,6 +130,6 @@ 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' ]
+ sample: [ '/path/to/file.yaml', '/path/to/file.json' ]
version_added: 2.4
'''