Let’s imagine I have a template like the one below:
{{ with $myvar := key <some key> }}
<do something>
{{ end }}
I would like to reuse the above template by, somehow, passing a different key. In other words, I would like to pass different some key values and render the same template.
Loading templates from a file is not currently supported. We’re tracking this feature request in hashicorp/consul-template#1402. I recommend leaving a reaction on the existing issue description so that we can track interest in this enhancement.