Writing the template file to disk
Reading it into file.template
Then writing to the dest is kinda complicated.
Would be easier to have something like:
template = assets.read("systemd-template.j2")
file.template(template, "/etc/systemd/service.conf", {service_name="abc", service_desc="xyz"})
Update the file.template function to take in a string instead of a file path and perform the template operation on the input string.
Instead of writing to a file on disk return the result of the templating as a string.
Writing the template file to disk
Reading it into
file.templateThen writing to the dest is kinda complicated.
Would be easier to have something like:
Update the file.template function to take in a string instead of a file path and perform the template operation on the input string.
Instead of writing to a file on disk return the result of the templating as a string.