From 7d044c26529a72915758c5ee2eb37747ecb67079 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 18 Aug 2026 02:20:57 +0200 Subject: [PATCH] fix(sys-svc-rdbms): seed dedicated databases into the backup, not just central ones baudolo dumps only what databases.csv names, and the entry was seeded from the central branch alone. An application running its own engine - Discourse with svc-db-postgres absent from the group - therefore never reached the seed: databases.csv stayed empty, baudolo warned that it was continuing without dumps, and the volume was stored as a raw PGDATA tree that restores a torn cluster. Whether a database must be backed up is a property of there being one, not of it being central, so both branches now include the same helper with their own gate: centrally the host from the provider group seeds, dedicated the stack host itself. The coordinates come from the same lookup either way. Verified without a deploy that the row this writes is the row baudolo looks for: the seed records the consumer entity as the instance, and baudolo derives the same key from the container name (discourse-database -> discourse). A mismatch there would have filled databases.csv and still produced no dump. Co-Authored-By: Claude Opus 5 (1M context) --- roles/sys-svc-rdbms/tasks/dedicated.yml | 6 ++++++ roles/sys-svc-rdbms/tasks/main.yml | 2 +- roles/sys-svc-rdbms/tasks/utils/seed_backup.yml | 12 ++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 roles/sys-svc-rdbms/tasks/utils/seed_backup.yml diff --git a/roles/sys-svc-rdbms/tasks/dedicated.yml b/roles/sys-svc-rdbms/tasks/dedicated.yml index c88eaddef2..4ac64275c1 100644 --- a/roles/sys-svc-rdbms/tasks/dedicated.yml +++ b/roles/sys-svc-rdbms/tasks/dedicated.yml @@ -14,3 +14,9 @@ - name: "🔧 For '{{ application_id }}/{{ _database_consumer_id }}': Apply postgres setup" include_tasks: dedicated_postgres.yml when: _database_type == 'postgres' + +- name: "🔧 For '{{ application_id }}/{{ _database_consumer_id }}': Seed the backup entry" + include_tasks: utils/seed_backup.yml + when: + - "'svc-bkp-volume-2-local' in group_names" + - IS_STACK_HOST | bool diff --git a/roles/sys-svc-rdbms/tasks/main.yml b/roles/sys-svc-rdbms/tasks/main.yml index bf22374dc5..0921afd66a 100644 --- a/roles/sys-svc-rdbms/tasks/main.yml +++ b/roles/sys-svc-rdbms/tasks/main.yml @@ -44,7 +44,7 @@ database_consumer_id: "{{ _database_consumer_id }}" - name: "➕ For '{{ application_id }}': Add Entry for Backup Procedure" - include_tasks: "{{ lookup('path_absolute', 'roles/svc-bkp-volume-2-local/tasks/03_seed-database-to-backup.yml') }}" + include_tasks: utils/seed_backup.yml when: - "'svc-bkp-volume-2-local' in group_names" - IS_STACK_HOST | bool diff --git a/roles/sys-svc-rdbms/tasks/utils/seed_backup.yml b/roles/sys-svc-rdbms/tasks/utils/seed_backup.yml new file mode 100644 index 0000000000..3e47f531eb --- /dev/null +++ b/roles/sys-svc-rdbms/tasks/utils/seed_backup.yml @@ -0,0 +1,12 @@ +--- +- name: "➕ For '{{ application_id }}/{{ _database_consumer_id }}': Add Entry for Backup Procedure" + include_tasks: "{{ lookup('path_absolute', 'roles/svc-bkp-volume-2-local/tasks/03_seed-database-to-backup.yml') }}" + vars: + database_consumer_id: "{{ _database_consumer_id }}" + database_type: "{{ _database_type }}" + database_instance: "{{ lookup('database', _database_consumer_id, 'instance') }}" + database_host: "{{ lookup('database', _database_consumer_id, 'host') }}" + database_port: "{{ lookup('database', _database_consumer_id, 'port') }}" + database_name: "{{ lookup('database', _database_consumer_id, 'name') }}" + database_username: "{{ lookup('database', _database_consumer_id, 'username') }}" + database_password: "{{ lookup('database', _database_consumer_id, 'password') }}"