service: Support postgres >= 18 and postgres upgrades
This commit is contained in:
@@ -22,7 +22,8 @@ service_database_type: none
|
||||
service_database_additional_networks: []
|
||||
service_database_secret_type: mount
|
||||
service_database_secret_target: "{{ service_database_type }}"
|
||||
service_postgres_image: docker.io/library/postgres
|
||||
service_postgres_image: docker.io/pgautoupgrade/pgautoupgrade
|
||||
service_postgres_tag: alpine
|
||||
service_redis: false
|
||||
|
||||
service_additional_containers: []
|
||||
|
||||
@@ -294,7 +294,7 @@ argument_specs:
|
||||
description:
|
||||
- Postgresql version to use.
|
||||
- Can be debian (n) or alpine-based (n-alpine), where n can be major version like 14 or minor like 14.13.
|
||||
- Required if service_database_type is postgres, does nothing otherwise
|
||||
- Ignored if database type is not postgres.
|
||||
- If a custom postgres image is specified, see that image documentation for supported tags.
|
||||
type: str
|
||||
required: false
|
||||
|
||||
@@ -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 }}"
|
||||
|
||||
Reference in New Issue
Block a user