The simplest templating
2026-02-01
Looking for some simple way of "parametrizing" stuff in Systemd unit files (or other configuation files), i found this tool called envsubst. you can place some ENV var name in your config file, like $(DATA_DIR) and then you can write a little script where you go EXPORT DATA_DIR=/path/to/data and envsubst < template-file > target-file and it gets replaced.
This makes it easy to have a set of "key-value" pairs at the top of the script, and then generate a whole set of config files using your values - avoiding all the overhead and footguns of ansible, jinja2 or other similar utilities. Looks like a classic situation of "do one thing and do it well" unix philosophy win.
Let's see if it actually works out like that, my project is still WIP.