Skip to content

Commit 05bbf18

Browse files
authored
Update documentation about vars: in roles: since they're no longer added to the play's variables (#1181)
1 parent 39e1e29 commit 05bbf18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/docsite/rst/playbook_guide/playbooks_reuse_roles.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ You can pass other keywords to the ``roles`` option:
151151
152152
When you add a tag to the ``role`` option, Ansible applies the tag to ALL tasks within the role.
153153

154-
When using ``vars:`` within the ``roles:`` section of a playbook, the variables are added to the play variables, making them available to all tasks within the play before and after the role. This behavior can be changed by :ref:`DEFAULT_PRIVATE_ROLE_VARS`.
154+
.. note::
155+
156+
Prior to ``ansible-core`` 2.15, ``vars:`` within the ``roles:`` section of a playbook are added to the play variables, making them available to all tasks within the play before and after the role. This behavior can be changed by :ref:`DEFAULT_PRIVATE_ROLE_VARS`. On more recent versions, ``vars:`` do not leak into the play's variable scope.
155157

156158
Including roles: dynamic reuse
157159
------------------------------

0 commit comments

Comments
 (0)