Browse code

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

sgpinkus authored on 2021/03/26 05:05:50
Showing 1 changed files
... ...
@@ -206,16 +206,16 @@ You can define different variables for each individual host, or set shared varia
206 206
 
207 207
 .. _playbook_variables:
208 208
 
209
-Defining variables in a playbook
209
+Defining variables in a play
210
+----------------------------
210 211
 
211
-You can define variables directly in a playbook::
212
+You can define variables directly in a playbook play::
212 213
 
213 214
    - hosts: webservers
214 215
      vars:
215 216
        http_port: 80
216 217
 
217
-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.
218
+When you define variables in a play, they are only visible to tasks executed in that play.
218 219
 
219 220
 .. _included_variables:
220 221
 .. _variable_file_separation_details: