How template files(.tmpl) are generated?

I saw keepalived template file in /usr/share/vyos/templates/vrrp/keepalived.conf.tmpl. I would like to modify this file, but look like it in generated automatically by VyOS.
Do you know which code generates content of this file?

It doesn’t generate automatically
source code keepalived-template

Thanks for your reply. So in order to modify this file, I have to make the change in vyos-1x, recompile the package and install it?
If I modify the file directly, does the changes survive after reboot or commit?

At the development stage, you can modify it in the working system. Or build pkg with your changes.
After that just reboot the router or restart vyos-configd service.
With the next system update, it will be original values from vyos-1x

Got it. Thank you, Viacheslav.