Answer the question
In order to leave comments, you need to log in
How to merge multiple files into one in Ansible?
Before using Ansible was very simple. Now, in general, the same seems to be a simple thing, but how to solve it is not very clear to me.
The question, to which I have not found an answer, is it possible to somehow merge files at all?
Namely, take one file another file (third, fourth + n) and create its contents in a variable ?
You can take for example lineinfile and add / remove the necessary lines, but I wanted to take this from another file / files.
patterns? Alas, I am very unfamiliar with them.
There is another thought through the shell , the usual stupid cat.
Collect files and scatter where necessary.
Answer the question
In order to leave comments, you need to log in
Assemble for simple cases (for example, glue public keys).
Something more complicated can be done with a script or your own module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question