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
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/d0324ec5-8a18-4b3d-91d7-0810059e94ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.