Hello,
When creating multi-line variables, I would often use the following technique to insert tabs in ansible 1.x:
myvar: |
{{'\t'}}one
{{'\t'}}two
{{'\t'}}three
This would result in the 3 lines being indented by a tab character in the resulting file. However this does not seem to work in ansible 2.x - the literal \t
characters get written to the file rather than expanded to a tab.
If I try to directly insert tab characters in the variable itself, I get a YAML syntax error due to the extra indentation on the line right after the variable name:
myvar: |
one
two
three
What does appear to work is to add an empty character on the beginning of that first line, and then follow it with the tab:
myvar: |
{{''}} one
two
three
This works but distorts the formatting of the variable and is hard to read. How can I correctly denote tab characters in multi-line variables in ansible 2.x?
Thanks,
Andrew