Clarify include_role documentation to indicate play vs playbook (#73011)

* Clarify include_role documentation to indicate play vs playbook. Fixes #73006

* Additional clarifications
pull/73017/head
Matt Martz 4 years ago committed by GitHub
parent 8e022ef00a
commit 13bf04e95a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,7 +53,7 @@ options:
version_added: '2.8' version_added: '2.8'
notes: notes:
- Handlers are made available to the whole play. - Handlers are made available to the whole play.
- Since Ansible 2.7 variables defined in C(vars) and C(defaults) for the role are exposed at playbook parsing time. - Since Ansible 2.7 variables defined in C(vars) and C(defaults) for the role are exposed to the play at playbook parsing time.
Due to this, these variables will be accessible to roles and tasks executed before the location of the Due to this, these variables will be accessible to roles and tasks executed before the location of the
M(ansible.builtin.import_role) task. M(ansible.builtin.import_role) task.
- Unlike M(ansible.builtin.include_role) variable exposure is not configurable, and will always be exposed. - Unlike M(ansible.builtin.include_role) variable exposure is not configurable, and will always be exposed.

@ -15,7 +15,7 @@ module: include_role
short_description: Load and execute a role short_description: Load and execute a role
description: description:
- Dynamically loads and executes a specified role as a task. - Dynamically loads and executes a specified role as a task.
- May be used only where Ansible tasks are allowed - inside C(pre_tasks), C(tasks), or C(post_tasks) playbook objects, or as a task inside a role. - May be used only where Ansible tasks are allowed - inside C(pre_tasks), C(tasks), or C(post_tasks) play objects, or as a task inside a role.
- Task-level keywords, loops, and conditionals apply only to the C(include_role) statement itself. - Task-level keywords, loops, and conditionals apply only to the C(include_role) statement itself.
- To apply keywords to the tasks within the role, pass them using the C(apply) option or use M(ansible.builtin.import_role) instead. - To apply keywords to the tasks within the role, pass them using the C(apply) option or use M(ansible.builtin.import_role) instead.
- Ignores some keywords, like C(until) and C(retries). - Ignores some keywords, like C(until) and C(retries).
@ -54,10 +54,10 @@ options:
default: yes default: yes
public: public:
description: description:
- This option dictates whether the role's C(vars) and C(defaults) are exposed to the playbook. If set to C(yes) - This option dictates whether the role's C(vars) and C(defaults) are exposed to the play. If set to C(yes)
the variables will be available to tasks following the C(include_role) task. This functionality differs from the variables will be available to tasks following the C(include_role) task. This functionality differs from
standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed at standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed
playbook parsing time, and available to earlier roles and tasks as well. to the play at playbook parsing time, and available to earlier roles and tasks as well.
type: bool type: bool
default: no default: no
version_added: '2.7' version_added: '2.7'

Loading…
Cancel
Save