Files
computer-playbook/roles/sys-svc-rdbms/templates/initdb.d/extensions.sql.j2
kevinveenbirkenbachandClaude Opus 4.7 6ad3814e15 feat(sys-svc-rdbms): apply postgres extensions for shared:false consumers via initdb.d mount
sys-svc-rdbms now renders an extensions.sql into a per-consumer
.initdb.d/ directory and bind-mounts it into the dedicated postgres
container at /docker-entrypoint-initdb.d/. CREATE EXTENSION runs as
POSTGRES_USER (= bootstrap superuser) on first initdb so non-trusted
extensions succeed. Same declarative source (service_extensions
lookup, services.yml extensions field) drives both shared:true
(02_init.yml loop) and shared:false (initdb.d) paths. database lookup
exposes a new initdb_dir field; service_extensions lookup loses its
shared:true guard (shared:false is now a real path). Refactored
repeated lookups in sys-svc-rdbms tasks into vars/main.yml.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:55:00 +02:00

4 lines
146 B
Django/Jinja

{% for ext in lookup('service_extensions', 'postgres').get(_database_consumer_id, []) %}
CREATE EXTENSION IF NOT EXISTS "{{ ext }}";
{% endfor %}