database DNS entry in consul

This commit is contained in:
vincent 2023-11-01 08:42:04 +01:00
parent 8718bfe051
commit 4cd583622b
18 changed files with 35 additions and 18 deletions

View File

@ -18,3 +18,6 @@ postgresql_databases:
owner: vikunja
- name: ghostfolio
owner: ghostfolio
postgres_consul_service: true
postgres_consul_service_name: db

View File

@ -0,0 +1 @@
postgres_consul_tag: "active"

View File

@ -0,0 +1 @@
postgres_consul_tag: "standby"

View File

@ -4,10 +4,16 @@ gerard
[dhcp]
gerard
[database]
oscar
[database_active]
bleys
[database_standby]
oscar
[database:children]
database_active
database_standby
[rsyncd]
oscar
bleys

View File

@ -1,9 +1,15 @@
[DNS]
oscar-dev
[database]
[database_active]
oscar-dev
[database_standby]
[database:children]
database_active
database_standby
[wireguard:children]
staging

View File

@ -12,7 +12,7 @@ job "backup-postgress" {
value = "amd64"
}
periodic {
cron = "0 3 * * *"
crons = ["0 3 * * *"]
prohibit_overlap = true
}
group "backup-postgress" {
@ -38,7 +38,7 @@ job "backup-postgress" {
{{ with secret "secrets/data/database/dump"}}
PGUSER = "dump"
PGPASSWORD = "{{ .Data.data.password }}"
PGHOST = "db1.ducamps.win"
PGHOST = "active.db.service.consul"
{{end}}
EOH
destination = "secrets/secrets.env"

View File

@ -64,7 +64,7 @@ global:
database:
{{ with secret "secrets/data/database/dendrite"}}
connection_string: postgresql://dendrite:{{.Data.data.password}}@db1.ducamps.win/dendrite?sslmode=disable
connection_string: postgresql://dendrite:{{.Data.data.password}}@active.db.service.consul/dendrite?sslmode=disable
{{end}}
max_open_conns: 100

View File

@ -63,7 +63,7 @@ job "nextcloud" {
NEXTCLOUD_ADMIN_USER="vincent"
NEXTCLOUD_ADMIN_PASSWORD="{{ .Data.data.ADMIN_PASSWORD }}"
NEXTCLOUD_TRUSTED_DOMAINS="file.ducamps.win"
POSTGRES_HOST="db1.ducamps.win"
POSTGRES_HOST="active.db.service.consul"
{{end}}
EOH
destination = "secrets/nextcloud.env"

View File

@ -56,7 +56,7 @@ job "wikijs" {
data= <<EOH
{{ with secret "secrets/data/database/wikijs"}}
DB_TYPE="postgres"
DB_HOST="db1.ducamps.win"
DB_HOST="active.db.service.consul"
DB_PORT="5432"
DB_USER="wikijs"
DB_PASS="{{.Data.data.password}}"

View File

@ -68,7 +68,7 @@ job "drone" {
{{end}}
{{ with secret "secrets/data/database/droneci"}}
DRONE_DATABASE_DATASOURCE="postgres://drone:{{ .Data.data.password }}@db1.ducamps.win:5432/drone?sslmode=disable"
DRONE_DATABASE_DATASOURCE="postgres://drone:{{ .Data.data.password }}@active.db.service.consul:5432/drone?sslmode=disable"
{{end}}
EOH
destination = "secrets/drone.env"

View File

@ -69,7 +69,7 @@ job "ghostfolio" {
template {
data= <<EOH
{{ with secret "secrets/data/database/ghostfolio"}}
DATABASE_URL = postgresql://ghostfolio:{{.Data.data.password}}@db1.ducamps.win:5432/ghostfolio?connect_timeout=300&sslmode=prefer
DATABASE_URL = postgresql://ghostfolio:{{.Data.data.password}}@active.db.service.consul/ghostfolio?connect_timeout=300&sslmode=prefer
{{end}}
{{ with secret "secrets/data/nomad/ghostfolio"}}
ACCESS_TOKEN_SALT = {{.Data.data.token}}

View File

@ -74,7 +74,7 @@ job "git" {
GITEA__server__SSH_LISTEN_PORT = "2222"
GITEA__server__START_SSH_SERVER = "false"
GITEA__database__DB_TYPE = "postgres"
GITEA__database__HOST = "db1.ducamps.win"
GITEA__database__HOST = "active.db.service.consul"
GITEA__database__NAME = "gitea"
GITEA__database__USER = "gitea"
GITEA__service__DISABLE_REGISTRATION = "true"

View File

@ -75,7 +75,7 @@ job "paperless-ng" {
}
env {
PAPERLESS_REDIS = "redis://${NOMAD_ADDR_redis}"
PAPERLESS_DBHOST = "db1.ducamps.win"
PAPERLESS_DBHOST = "active.db.service.consul"
PAPERLESS_DBNAME = "paperless"
PAPERLESS_DBUSER = "paperless"
PAPERLESS_OCR_LANGUAGE = "fra"

View File

@ -12,7 +12,7 @@ job "seedboxsync" {
value = "amd64"
}
periodic {
cron = "0,30 * * * *"
crons = ["0,30 * * * *"]
prohibit_overlap = true
}
group "seedboxsync" {

View File

@ -114,7 +114,7 @@ http {
template {
data = <<EOH
{{ with secret "secrets/data/database/supysonic"}}
SUPYSONIC_DB_URI = "postgres://supysonic:{{ .Data.data.password}}@db1.ducamps.win/supysonic"
SUPYSONIC_DB_URI = "postgres://supysonic:{{ .Data.data.password}}@active.db.service.consul/supysonic"
{{end}}
{{ with secret "secrets/data/nomad/supysonic"}}
SUPYSONIC_LDAP_BIND_DN = "{{ .Data.data.serviceAccountName }}"

View File

@ -60,7 +60,7 @@ job "tt-rss" {
}
env {
TTRSS_DB-TYPE = "pgsql"
TTRSS_DB_HOST = "db1.ducamps.win"
TTRSS_DB_HOST = "active.db.serice.consul"
TTRSS_DB_NAME = "ttrss"
TTRSS_DB_USER = "ttrss"
TTRSS_SELF_URL_PATH = "https://www.ducamps.win/tt-rss"
@ -92,7 +92,7 @@ job "tt-rss" {
}
env {
TTRSS_DB-TYPE = "pgsql"
TTRSS_DB_HOST = "db1.ducamps.win"
TTRSS_DB_HOST = "active.db.service.consul"
TTRSS_DB_NAME = "ttrss"
TTRSS_DB_USER = "ttrss"
TTRSS_SELF_URL_PATH = "https://www.ducamps.win/tt-rss"

View File

@ -67,7 +67,7 @@ job "vaultwarden" {
template {
data = <<EOH
{{ with secret "secrets/data/database/vaultwarden"}}
DATABASE_URL=postgresql://vaultwarden:{{ .Data.data.password }}@db1.ducamps.win/vaultwarden
DATABASE_URL=postgresql://vaultwarden:{{ .Data.data.password }}@active.db.service.consul/vaultwarden
{{end}}
EOH
destination = "secrets/vaultwarden.env"

View File

@ -39,7 +39,7 @@ job "vikunja" {
ports = ["api"]
}
env {
VIKUNJA_DATABASE_HOST = "db1.ducamps.win"
VIKUNJA_DATABASE_HOST = "active.db.service.consul"
VIKUNJA_DATABASE_TYPE = "postgres"
VIKUNJA_DATABASE_USER = "vikunja"
VIKUNJA_DATABASE_DATABASE = "vikunja"