2019-01-16 17:05:48 +01:00
matrix_postgres_enabled : true
2021-01-22 11:23:00 +01:00
matrix_postgres_connection_hostname : "matrix-postgres"
matrix_postgres_connection_port : 5432
matrix_postgres_connection_username : "matrix"
2019-01-16 17:05:48 +01:00
matrix_postgres_connection_password : ""
2021-01-22 11:23:00 +01:00
matrix_postgres_db_name : "matrix"
2019-01-12 16:53:00 +01:00
matrix_postgres_base_path : "{{ matrix_base_data_path }}/postgres"
matrix_postgres_data_path : "{{ matrix_postgres_base_path }}/data"
2021-01-22 12:52:55 +01:00
matrix_postgres_architecture : amd64
# matrix_postgres_docker_image_suffix controls whether we use Alpine-based images (`-alpine`) or the normal Debian-based images.
# Alpine-based Postgres images are smaller and we usually prefer them, but they don't work on ARM32 (tested on a Raspberry Pi 3 running Raspbian 10.7).
# On ARM32, `-alpine` images fail with the following error:
# > LOG: startup process (PID 37) was terminated by signal 11: Segmentation fault
matrix_postgres_docker_image_suffix : "{{ '-alpine' if matrix_postgres_architecture in ['amd64', 'arm64'] else '' }}"
2021-04-12 14:39:16 +02:00
matrix_postgres_docker_image_v9 : "{{ matrix_container_global_registry_prefix }}postgres:9.6.21{{ matrix_postgres_docker_image_suffix }}"
matrix_postgres_docker_image_v10 : "{{ matrix_container_global_registry_prefix }}postgres:10.16{{ matrix_postgres_docker_image_suffix }}"
matrix_postgres_docker_image_v11 : "{{ matrix_container_global_registry_prefix }}postgres:11.11{{ matrix_postgres_docker_image_suffix }}"
matrix_postgres_docker_image_v12 : "{{ matrix_container_global_registry_prefix }}postgres:12.6{{ matrix_postgres_docker_image_suffix }}"
matrix_postgres_docker_image_v13 : "{{ matrix_container_global_registry_prefix }}postgres:13.2{{ matrix_postgres_docker_image_suffix }}"
2020-09-30 23:40:24 +02:00
matrix_postgres_docker_image_latest : "{{ matrix_postgres_docker_image_v13 }}"
2019-04-30 16:35:18 +02:00
2019-06-10 13:23:51 +02:00
# This variable is assigned at runtime. Overriding its value has no effect.
matrix_postgres_docker_image_to_use : '{{ matrix_postgres_docker_image_latest }}'
matrix_postgres_docker_image_force_pull : "{{ matrix_postgres_docker_image_to_use.endswith(':latest') }}"
2019-04-30 16:35:18 +02:00
# A list of extra arguments to pass to the container
matrix_postgres_container_extra_arguments : [ ]
2019-06-10 03:35:35 +02:00
2020-09-11 14:29:10 +02:00
# A list of extra arguments to pass to the postgres process
# e.g. "-c 'max_connections=200'"
matrix_postgres_process_extra_arguments : [ ]
2019-06-10 03:35:35 +02:00
# Controls whether the matrix-postgres container exposes a port (tcp/5432 in the
2019-06-10 07:24:37 +02:00
# container) that can be used to access the database from outside the container (e.g. with psql)
2019-06-10 03:35:35 +02:00
#
# psql postgresql://username:password@localhost:<port>/database_name
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:5432"), or empty string to not expose.
matrix_postgres_container_postgres_bind_port : ""
2019-07-08 08:38:24 +02:00
2020-12-13 20:07:16 +01:00
# A list of additional (databases and their credentials) to create.
#
# Example:
# matrix_postgres_additional_databases:
# - name: matrix_appservice_discord
2020-12-13 20:43:53 +01:00
# username: matrix_appservice_discord
2020-12-13 23:43:03 +01:00
# password: some_password
2020-12-13 20:07:16 +01:00
# - name: matrix_appservice_slack
2020-12-13 20:43:53 +01:00
# username: matrix_appservice_slack
2020-12-13 23:43:03 +01:00
# password: some_password
2020-12-13 20:07:16 +01:00
matrix_postgres_additional_databases : [ ]
2020-12-13 23:59:59 +01:00
2020-12-14 21:28:20 +01:00
# A list of roles/users to avoid creating when importing (or upgrading) the database.
# If a dump file contains the roles and they've also been created beforehand (see `matrix_postgres_additional_databases`),
# importing would fail.
# We either need to not create them or to ignore the `CREATE ROLE` statements in the dump.
matrix_postgres_import_roles_to_ignore : [ matrix_postgres_connection_username]
matrix_postgres_import_roles_ignore_regex : "^CREATE ROLE ({{ matrix_postgres_import_roles_to_ignore|join('|') }});"
# A list of databases to avoid creating when importing (or upgrading) the database.
# If a dump file contains the databases and they've also been created beforehand (see `matrix_postgres_additional_databases`),
# importing would fail.
# We either need to not create them or to ignore the `CREATE DATABASE` statements in the dump.
matrix_postgres_import_databases_to_ignore : [ matrix_postgres_db_name]
matrix_postgres_import_databases_ignore_regex : "^CREATE DATABASE ({{ matrix_postgres_import_databases_to_ignore|join('|') }})\\s"
2020-12-13 23:59:59 +01:00
# The number of seconds to wait after starting `matrix-postgres.service`
# and before trying to run queries for creating additional databases/users against it.
#
# For most (subsequent) runs, Postgres would already be running, so no waiting will be happening at all.
2021-01-22 15:21:30 +01:00
#
# On ARM, we wait some more. ARM32 devices are especially known for being slow.
# ARM64 likely don't need such a long delay, but it doesn't hurt too much having it.
matrix_postgres_additional_databases_postgres_start_wait_timeout_seconds : "{{ 45 if matrix_postgres_architecture in ['arm32', 'arm64'] else 15 }}"
2020-12-14 01:23:29 +01:00
2020-12-23 08:08:54 +01:00
matrix_postgres_pgloader_container_image_self_build : false
matrix_postgres_pgloader_container_image_self_build_repo : "https://github.com/illagrenan/pgloader-docker.git"
matrix_postgres_pgloader_container_image_self_build_repo_branch : "v{{ matrix_postgres_pgloader_docker_image_tag }}"
matrix_postgres_pgloader_container_image_self_build_src_path : "{{ matrix_postgres_base_path }}/pgloader-container-src"
# We use illagrenan/pgloader, instead of the more official dimitri/pgloader image,
# because the official one only provides a `latest` tag.
matrix_postgres_pgloader_docker_image : "{{ matrix_postgres_pgloader_docker_image_name_prefix }}illagrenan/pgloader:{{ matrix_postgres_pgloader_docker_image_tag }}"
2021-04-12 14:39:16 +02:00
matrix_postgres_pgloader_docker_image_name_prefix : "{{ 'localhost/' if matrix_postgres_pgloader_container_image_self_build else matrix_container_global_registry_prefix }}"
2020-12-23 08:08:54 +01:00
matrix_postgres_pgloader_docker_image_tag : "3.6.2"
matrix_postgres_pgloader_docker_image_force_pull : "{{ matrix_postgres_pgloader_docker_image.endswith(':latest') }}"