I wanted to pass multiple consul key-value pairs to my nomad job and this is the template from the documentation that I’ve tried to use on my nomad job.
template {
data = <<EOF
{{range ls "app/test"}}
{{.Key}}={{.Value}}
{{end}}
EOF
destination = "env/file.env"
env = true
}
When I try consul kv get -recurse app/test
this is the result:
app/test/:
app/test/APP_NAME:consul
app/test/TEST_KEY:123
I’m not getting the consul kv even though the nomad job is running without any errors. Are there other configurations on the job or perhaps on the setup that I might have missed?