diff options
author | Michael Mayer <mjmayer@ucdavis.edu> | 2022-12-13 14:12:14 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-13 17:12:14 -0500 |
commit | aa268b8db27193dd3f842ad72860ec3aefc3620d (patch) | |
tree | 054ed9b97324440ef2c4d30b100e0719f4158dfc | |
parent | b3a1eabb7d7266eec3edac1b8b7810f0062707ed (diff) | |
download | ansible-aa268b8db27193dd3f842ad72860ec3aefc3620d.tar.gz |
Add example of yaml file with --extra-vars (#79521)
-rw-r--r-- | docs/docsite/rst/playbook_guide/playbooks_variables.rst | 4 |
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: |