From 13bf04e95a829e40b3f078b6956989bb080ceb2a Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 17 Dec 2020 13:28:16 -0600 Subject: [PATCH] Clarify include_role documentation to indicate play vs playbook (#73011) * Clarify include_role documentation to indicate play vs playbook. Fixes #73006 * Additional clarifications --- lib/ansible/modules/import_role.py | 2 +- lib/ansible/modules/include_role.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/import_role.py b/lib/ansible/modules/import_role.py index 9e3df6cb68e..60eddbdc45e 100644 --- a/lib/ansible/modules/import_role.py +++ b/lib/ansible/modules/import_role.py @@ -53,7 +53,7 @@ options: version_added: '2.8' notes: - 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 M(ansible.builtin.import_role) task. - Unlike M(ansible.builtin.include_role) variable exposure is not configurable, and will always be exposed. diff --git a/lib/ansible/modules/include_role.py b/lib/ansible/modules/include_role.py index cf1f3730bef..3cca919ac45 100644 --- a/lib/ansible/modules/include_role.py +++ b/lib/ansible/modules/include_role.py @@ -15,7 +15,7 @@ module: include_role short_description: Load and execute a role description: - 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. - 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). @@ -54,10 +54,10 @@ options: default: yes public: 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 - standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed at - playbook parsing time, and available to earlier roles and tasks as well. + standard variable exposure for roles listed under the C(roles) header or C(import_role) as they are exposed + to the play at playbook parsing time, and available to earlier roles and tasks as well. type: bool default: no version_added: '2.7'