summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Mayer <mjmayer@ucdavis.edu>2022-12-13 14:12:14 -0800
committerGitHub <noreply@github.com>2022-12-13 17:12:14 -0500
commitaa268b8db27193dd3f842ad72860ec3aefc3620d (patch)
tree054ed9b97324440ef2c4d30b100e0719f4158dfc
parentb3a1eabb7d7266eec3edac1b8b7810f0062707ed (diff)
downloadansible-aa268b8db27193dd3f842ad72860ec3aefc3620d.tar.gz
Add example of yaml file with --extra-vars (#79521)
-rw-r--r--docs/docsite/rst/playbook_guide/playbooks_variables.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/docs/docsite/rst/playbook_guide/playbooks_variables.rst b/docs/docsite/rst/playbook_guide/playbooks_variables.rst
index ad31c0ea05..9482845dfd 100644
--- a/docs/docsite/rst/playbook_guide/playbooks_variables.rst
+++ b/docs/docsite/rst/playbook_guide/playbooks_variables.rst
@@ -331,14 +331,16 @@ When passing variables with ``--extra-vars``, you must escape quotes and other s
ansible-playbook arcade.yml --extra-vars '{"name":"Conan O'\\\''Brien"}'
ansible-playbook script.yml --extra-vars "{\"dialog\":\"He said \\\"I just can\'t get enough of those single and double-quotes"\!"\\\"\"}"
-If you have a lot of special characters, use a JSON or YAML file containing the variable definitions.
vars from a JSON or YAML file
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+If you have a lot of special characters, use a JSON or YAML file containing the variable definitions. Prepend both JSON and YAML filenames with `@`.
+
.. code-block:: text
ansible-playbook release.yml --extra-vars "@some_file.json"
+ ansible-playbook release.yml --extra-vars "@some_file.yaml"
.. _ansible_variable_precedence: