Add example of yaml file with --extra-vars (#79521)

pull/79594/head
Michael Mayer 2 years ago committed by GitHub
parent b3a1eabb7d
commit aa268b8db2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save