database DNS entry in consul
This commit is contained in:
parent
8718bfe051
commit
4cd583622b
@ -18,3 +18,6 @@ postgresql_databases:
|
||||
owner: vikunja
|
||||
- name: ghostfolio
|
||||
owner: ghostfolio
|
||||
|
||||
postgres_consul_service: true
|
||||
postgres_consul_service_name: db
|
||||
|
1
ansible/group_vars/database_active
Normal file
1
ansible/group_vars/database_active
Normal file
@ -0,0 +1 @@
|
||||
postgres_consul_tag: "active"
|
1
ansible/group_vars/database_standby
Normal file
1
ansible/group_vars/database_standby
Normal file
@ -0,0 +1 @@
|
||||
postgres_consul_tag: "standby"
|
@ -4,10 +4,16 @@ gerard
|
||||
[dhcp]
|
||||
gerard
|
||||
|
||||
[database]
|
||||
oscar
|
||||
[database_active]
|
||||
bleys
|
||||
|
||||
[database_standby]
|
||||
oscar
|
||||
|
||||
[database:children]
|
||||
database_active
|
||||
database_standby
|
||||
|
||||
[rsyncd]
|
||||
oscar
|
||||
bleys
|
||||
|
@ -1,9 +1,15 @@
|
||||
[DNS]
|
||||
oscar-dev
|
||||
|
||||
[database]
|
||||
[database_active]
|
||||
oscar-dev
|
||||
|
||||
[database_standby]
|
||||
|
||||
[database:children]
|
||||
database_active
|
||||
database_standby
|
||||
|
||||
[wireguard:children]
|
||||
staging
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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}}"
|
||||
|
@ -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"
|
||||
|
@ -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}}
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -12,7 +12,7 @@ job "seedboxsync" {
|
||||
value = "amd64"
|
||||
}
|
||||
periodic {
|
||||
cron = "0,30 * * * *"
|
||||
crons = ["0,30 * * * *"]
|
||||
prohibit_overlap = true
|
||||
}
|
||||
group "seedboxsync" {
|
||||
|
@ -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 }}"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user