From 2abb2d3f17193a59d71c0a03ae1374a709f2db39 Mon Sep 17 00:00:00 2001 From: sgpinkus Date: Fri, 26 Mar 2021 07:05:50 +1100 Subject: [PATCH] Update playbooks_variables.rst. To say you can define variables within a playbook is somewhat misleading. Variables are defined within plays and are only visible within the play they are defined in *not* the entire playbook. There is no way to define vars to have strictly playbook scope. (#73986) +label: docsite_pr --- docs/docsite/rst/user_guide/playbooks_variables.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docsite/rst/user_guide/playbooks_variables.rst b/docs/docsite/rst/user_guide/playbooks_variables.rst index 75acc56ccc4..086043b629e 100644 --- a/docs/docsite/rst/user_guide/playbooks_variables.rst +++ b/docs/docsite/rst/user_guide/playbooks_variables.rst @@ -206,16 +206,16 @@ You can define different variables for each individual host, or set shared varia .. _playbook_variables: -Defining variables in a playbook --------------------------------- +Defining variables in a play +---------------------------- -You can define variables directly in a playbook:: +You can define variables directly in a playbook play:: - hosts: webservers vars: http_port: 80 -When you define variables in a playbook, they are visible to anyone who runs that playbook. This is especially useful if you share playbooks widely. +When you define variables in a play, they are only visible to tasks executed in that play. .. _included_variables: .. _variable_file_separation_details: