Support other poolers

This commit is contained in:
Daniel Berteaud 2024-01-11 22:11:12 +01:00
parent 038f04c886
commit 610075ab1c
2 changed files with 3 additions and 2 deletions

View File

@ -94,6 +94,7 @@ job "miniflux" {
task "miniflux" {
driver = "docker"

View File

@ -60,7 +60,7 @@ job [[ .instance | toJSON ]] {
[[ template "common/task.wait_for" $c ]]
[[ template "common/task.pgbouncer" $c ]]
[[ template "common/postgres_pooler" $c ]]
task "miniflux" {
driver = [[ $c.nomad.driver | toJSON ]]
@ -85,7 +85,7 @@ job [[ .instance | toJSON ]] {
template {
data =<<_EOT
DATABASE_URL=postgresql://
[[- if eq $c.postgres.pooler.engine "pgbouncer" -]]
[[- if ne $c.postgres.pooler.engine "none" -]]
[[ .instance ]]:{{ env "NOMAD_ALLOC_ID" }}@127.0.0.1:6432/[[ $c.postgres.database ]]?sslmode=disable
[[- else -]]
[[ $c.postgres.user ]]:[[ $c.postgres.password ]]@[[ $c.postgres.host ]]:[[ $c.postgres.port ]]/[[ $c.postgres.database ]]?sslmode=disable