I have yml
file with template. Template is a part of keys started from a middle of yml tree.
Templating works is ok, but indent is saved only for last key. How to save indent for all keys?
base.yml
:
app:
config1:
base: {{ service1.company.backend | to_nice_yaml(indent=2) }}
config2:
node: {{ service1.company.addr | to_nice_yaml(indent=2) }}
config.yml
:
service1:
company:
backend:
node1: "xxx"
node2: "yyy"
node3: "zzz"
addr:
street: ""
I need to get:
app:
config1:
base:
node1: "xxx"
node2: "yyy"
node3: "zzz"
config2:
node:
street: ""
But really result is:
app:
config1:
base:
node3: "zzz"
node1: "xxx"
node2: "yyy"
config2:
node:
street: ""
node1
and node2
don't save an indent and Jinja2 parser gets the last node. On next step incorrect file is used in other role which doesn't handle it correctly.
indent
works very well but I think to use the helper variable more properly. – Merideth