service: Support postgres >= 18 and postgres upgrades

This commit is contained in:
uumas
2026-03-12 00:26:35 +02:00
parent c673aae8dc
commit 470b60f988
3 changed files with 10 additions and 3 deletions

View File

@@ -1,6 +1,12 @@
---
_service_database_image: "{{ service_postgres_image }}:{{ service_postgres_tag }}"
_service_database_mount_destination: /var/lib/postgresql/data
_service_database_mount_destination: >-
{{
'/var/lib/postgresql/data'
if (service_postgres_tag | split('-') | length > 1)
and (service_postgres_tag | split('-') | first) is version('18', '<')
else '/var/lib/postgresql'
}}
_service_database_env:
POSTGRES_USER: "{{ service_name | replace('-', '_') }}"
POSTGRES_PASSWORD_FILE: "/run/secrets/{{ service_database_type }}"