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
This commit is contained in:
sgpinkus 2021-03-26 07:05:50 +11:00 committed by GitHub
parent 0bf9b7fdf8
commit 2abb2d3f17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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: