mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Improve YAMLSyntax/Gotchas (#21575)
* Improve YAMLSyntax/Gotchas Colons don't need to be quoted unless when followed by a space or the end of the line * Update YAMLSyntax.rst Minor edit.
This commit is contained in:
parent
7018aa3316
commit
10125d520d
1 changed files with 10 additions and 2 deletions
|
@ -123,11 +123,19 @@ While YAML is generally friendly, the following is going to result in a YAML syn
|
|||
|
||||
foo: somebody said I should put a colon here: so I did
|
||||
|
||||
You will want to quote any hash values using colons, like so::
|
||||
windows_drive: c:
|
||||
|
||||
...but this will work::
|
||||
|
||||
windows_path: c:\windows
|
||||
|
||||
You will want to quote hash values using colons followed by a space or the end of the line::
|
||||
|
||||
foo: "somebody said I should put a colon here: so I did"
|
||||
|
||||
And then the colon will be preserved.
|
||||
windows_drive: "c:"
|
||||
|
||||
...and then the colon will be preserved.
|
||||
|
||||
Further, Ansible uses "{{ var }}" for variables. If a value after a colon starts
|
||||
with a "{", YAML will think it is a dictionary, so you must quote it, like so::
|
||||
|
|
Loading…
Reference in a new issue