mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-03 07:59:42 +00:00
Refactor DB initialization handling: externalize database_init flag for svc-db-mariadb and svc-db-postgres, remove internal auto-detection, and pass explicit init signal from sys-stk-back-stateful. Improves clarity, avoids incorrect credential lookups, and stabilizes central DB setup.
Reference: ChatGPT conversation https://chatgpt.com/share/692def1c-a79c-800f-b7dd-35e1845424bf
This commit is contained in:
@@ -1 +1,2 @@
|
||||
postgres_gis_enabled: false # Needed by mobilizon
|
||||
postgres_gis_enabled: false # Needed by mobilizon
|
||||
database_init: false # When true a database is initialized
|
||||
@@ -11,4 +11,4 @@
|
||||
|
||||
- name: "Initialize database for '{{ database_name }}'"
|
||||
include_tasks: 02_init.yml
|
||||
when: POSTGRES_INIT | bool
|
||||
when: database_init | bool
|
||||
@@ -18,7 +18,6 @@ POSTGRES_NETWORK_NAME: "{{ applications | get_app_conf(applic
|
||||
POSTGRES_SUBNET: "{{ networks.local['svc-db-postgres'].subnet }}"
|
||||
POSTGRES_PASSWORD: "{{ applications | get_app_conf(application_id, 'credentials.POSTGRES_PASSWORD') }}"
|
||||
POSTGRES_PORT: "{{ database_port | default(ports.localhost.database[ application_id ]) }}"
|
||||
POSTGRES_INIT: "{{ database_username is defined and database_password is defined and database_name is defined }}"
|
||||
POSTGRES_EXPOSE_LOCAL: True # Exposes the db to localhost, almost everytime neccessary
|
||||
POSTGRES_CUSTOM_IMAGE_NAME: "postgres_custom"
|
||||
POSTGRES_LOCAL_HOST: "127.0.0.1"
|
||||
|
||||
Reference in New Issue
Block a user