Difference: AnsibleTipsTricks (10 vs. 11)

Revision 1108 Feb 2022 - IvoVanGeel

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Ansible tips & tricks

Line: 14 to 14
 dictionary:
key1: "value 1"
key2: "value 2"
Added:
>
>

YAML syntax

Split long lines

Use a backslash (\) to split long lines:

- fail:
    msg: "This is the first part \
          and second part of the string"

Results in: fatal: [localhost]: FAILED! => {"changed": false, "msg": "This is the first part and second part of the string"}

For other ways of splitting long lines, see: https://stackoverflow.com/questions/3790454/how-do-i-break-a-string-in-yaml-over-multiple-lines

 

Dump all variables

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2010-2019 by LANIS