Fix handling postgres settings

This commit is contained in:
Daniel Berteaud 2024-01-19 15:02:50 +01:00
parent 4d7e50a5a1
commit 6986b74c98
2 changed files with 3 additions and 5 deletions

View File

@ -83,10 +83,10 @@ _EOT
[[- if ne $c.postgres.pooler.engine "none" ]]
BOUNCA_DB_USER=[[ .instance ]]
BOUNCA_DB_PASSWORD={{ env "NOMAD_ALLOC_ID" }}
BOUNCA_DB_PORT=6432
BOUNCA_DB_PORT=[[ $c.postgres.pooler.port ]]
[[- else ]]
BOUNCA_DB_USER={{ with secret "[[ .vault.prefix ]]/database/creds/[[ .instance ]]" }}{{ .Data.username }}{{ end }}
BOUNCA_DB_PASSWORD={{ with secret "[[ .vault.prefix ]]/database/creds/[[ .instance ]]" }}{{ .Data.password }}{{ end }}
BOUNCA_DB_USER=[[ $c.postgres.user ]]
BOUNCA_DB_PASSWORD=[[ $c.postgres.password ]]
BOUNCA_DB_PORT=[[ $c.postgres.port ]]
[[- end ]]
_EOT

View File

@ -113,7 +113,6 @@ job "bounca" {
BOUNCA_HOST = "pki.example.org"
}
# Use a template block instead of env {} so we can fetch values from vault
template {
data = <<_EOT
@ -224,7 +223,6 @@ _EOT
BOUNCA_PUBLIC_DIR = "/alloc/data/public"
}
# Use a template block instead of env {} so we can fetch values from vault
template {
data = <<_EOT