I have a test service registered with Consul with the following service definition:
{
"name": "web",
"tags": ["web1"],
"address": "example.com",
"meta": {
"meta": "cluster",
"acl": "host_test",
"cluster": "test_cluster"
},
"port": 8000
}
And I want to load that information into HAProxy config using consul-template. I can get the address and port as instructed in the documentation:
{{ range service "web" }}{{if in .Tags "web1"}}
server {{.Node}} {{ .Address }}:{{.Port}} cookie A check
{{ end }}{{end}}
But I can't seem to get the meta information. I thought I can access that using something like this within the service range:
{{range .Meta}}
{{.}}{{end}}
Any idea how I can get acl or cluster out of meta?