Thanks for the info, that was my fallback plan. Perhaps you have some insight in how I could achieve the following since I'm just picking up the Go templating language:
I have a service named foo with n nodes, each node has multiple tags. I want to iterate on the tags that match the current node. I'm planning on having a HOSTNAME=`hostname -f` env var, so I am running:
HOSTNAME=`hostname -f` consul-template -config=/etc/consul-template.d/ -dry -once
I'm creating a YAML config file and hope this snippet explains what I'm trying to get to:
{{range $tag, $services := service "foo" || node := env($HOSTNAME) | byTag}}
{{.Tag}}:
consumer: {{key "service/foo/consumer/{{.Tag}}/class"}}
{{end}}
So for each tag in the service foo iterate the tags for this node, and then get key/value pairs based upon the tag being part of the KV tree.
Is this possible? If so, how would you go about it?