There is a content variable that I received via {{lookup ('template', 'config1.yml.j2')}} and which contains the contents of a single configuration file.

It is necessary, in another jinja template, drag out the contents of the content variable and place it into another file that has the structure of a yaml file of the form:

config_file: - name: 'file-name' mode: '0600' path: '/tmp/file-name' content: | < line1 > < line2 > < lineN > 

Line The Line is a configuration file from the variable content, which is indented relative to the beginning of the line, which I cannot achieve.

Maybe there are other options?

The main task is to get the finished file from the first template and save its contents in another file inside the yaml structure in the form described above.

    0