Support env from vault

This commit is contained in:
Daniel Berteaud 2024-01-22 11:53:35 +01:00
parent c403e74073
commit 4fa4e4452f

View File

@ -14,7 +14,13 @@
template {
data = <<_EOT
[[- range $k, $v := $env ]]
[[- if or (isKind "string" $v) (isKind "number" $v) ]]
[[ $k ]]=[[ $v ]]
[[- else if isKind "map" $v ]]
[[- if and (has $v "source") (eq $v.source "vault") ]]
[[ $k ]]={{ with secret "[[ if has $v "path" ]][[ $v.path ]][[ else ]][[ $.vault.kv.path ]][[ end ]]" }}{{ [[ $v.key ]] }}{{ end }}
[[- end ]]
[[- end ]]
[[- end ]]
_EOT
destination = "secrets/.env"