From 9c438a3870deee9b79c413385c2e36a9870c79e2 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 4 Oct 2019 08:51:32 +0300 Subject: [PATCH] Add support for Postgres v12 --- CHANGELOG.md | 9 +++++++++ docs/maintenance-postgres.md | 2 +- roles/matrix-postgres/defaults/main.yml | 3 ++- .../tasks/util/detect_existing_postgres_version.yml | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18ac6568c..a8eb4ca36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 2019-10-04 + +## Postgres 12 support + +The playbook now installs [Postgres 12](https://www.postgresql.org/about/news/1976/) by default. + +If you have have an existing setup, it's likely running on an older Postgres version (9.x, 10.x or 11.x). You can easily upgrade by following the [upgrading PostgreSQL guide](docs/maintenance-postgres.md#upgrading-postgresql). + + # 2019-10-03 ## Synapse 1.4.0 diff --git a/docs/maintenance-postgres.md b/docs/maintenance-postgres.md index c0f8b3255..dd9d4cfe6 100644 --- a/docs/maintenance-postgres.md +++ b/docs/maintenance-postgres.md @@ -42,7 +42,7 @@ docker run \ --rm \ --network matrix \ --env-file=/matrix/postgres/env-postgres-psql \ -postgres:11.1-alpine \ +postgres:12.0-alpine \ pg_dump -h matrix-postgres \ | gzip -c \ > /postgres.sql.gz diff --git a/roles/matrix-postgres/defaults/main.yml b/roles/matrix-postgres/defaults/main.yml index 10783be06..02a446d5c 100644 --- a/roles/matrix-postgres/defaults/main.yml +++ b/roles/matrix-postgres/defaults/main.yml @@ -11,7 +11,8 @@ matrix_postgres_data_path: "{{ matrix_postgres_base_path }}/data" matrix_postgres_docker_image_v9: "postgres:9.6.15-alpine" matrix_postgres_docker_image_v10: "postgres:10.10-alpine" matrix_postgres_docker_image_v11: "postgres:11.5-alpine" -matrix_postgres_docker_image_latest: "{{ matrix_postgres_docker_image_v11 }}" +matrix_postgres_docker_image_v12: "postgres:12.0-alpine" +matrix_postgres_docker_image_latest: "{{ matrix_postgres_docker_image_v12 }}" # This variable is assigned at runtime. Overriding its value has no effect. matrix_postgres_docker_image_to_use: '{{ matrix_postgres_docker_image_latest }}' diff --git a/roles/matrix-postgres/tasks/util/detect_existing_postgres_version.yml b/roles/matrix-postgres/tasks/util/detect_existing_postgres_version.yml index 524763534..805d0cbd5 100644 --- a/roles/matrix-postgres/tasks/util/detect_existing_postgres_version.yml +++ b/roles/matrix-postgres/tasks/util/detect_existing_postgres_version.yml @@ -44,3 +44,8 @@ set_fact: matrix_postgres_detected_version_corresponding_docker_image: "{{ matrix_postgres_docker_image_v10 }}" when: "matrix_postgres_detected_version == '10' or matrix_postgres_detected_version.startswith('10.')" + +- name: Determine corresponding Docker image to detected version (use 11.x, if detected) + set_fact: + matrix_postgres_detected_version_corresponding_docker_image: "{{ matrix_postgres_docker_image_v11 }}" + when: "matrix_postgres_detected_version == '11' or matrix_postgres_detected_version.startswith('11.')"