我正在努力在我的领事模板中嵌套环境变量以获得所需的结果。关于如何实现这一点的任何想法?
template {
data = <<EOH
{{ with secret "cluster/ca/issue/nomad-my-role" "common_name=socat.service.consul" "ip_sans=127.0.0.1" "alt_names={{ env "attr.unique.hostname" }}.node.primary.consul" "ip_sans={{ env "attr.unique.network.ip-address" }}" }}
{{- .Data.certificate -}}
{{ end }}
EOH
destination = "local/certificate.crt"
change_mode = "restart"
}