Add region and datacenter meta

And use conv.ToBool for .prometheus.enabled
This commit is contained in:
Daniel Berteaud 2024-03-27 11:53:56 +01:00
parent a7aba5105a
commit 3f9a0060ca
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
meta {
[[- if .prometheus.enabled ]]
[[- if conv.ToBool .prometheus.enabled ]]
[[- if not (has .consul.meta "metrics-port") ]]
metrics-port = "${NOMAD_HOST_PORT_metrics}"
[[- end ]]

View File

@ -81,6 +81,8 @@ consul:
job: '${NOMAD_JOB_NAME}'
group: '${NOMAD_GROUP_NAME}'
namespace: '${NOMAD_NAMESPACE}'
region: '${NOMAD_REGION}'
datacenter: '${NOMAD_DC}'
node: '${node.unique.name}'
# Consul connect config