Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

134 строки
7.8 KiB

  1. ---
  2. # Project source code URL: https://github.com/postgres/postgres
  3. # Controls if the Postgres server managed by the playbook is enabled.
  4. # You can turn it off and use an external Postgres server by setting this to `false`.
  5. # Doing this has various downsides. See `docs/configuring-playbook-external-postgres.md` to learn more.
  6. matrix_postgres_enabled: true
  7. matrix_postgres_connection_hostname: "matrix-postgres"
  8. matrix_postgres_connection_port: 5432
  9. matrix_postgres_connection_username: "matrix"
  10. matrix_postgres_connection_password: ""
  11. matrix_postgres_db_name: "matrix"
  12. matrix_postgres_base_path: "{{ matrix_base_data_path }}/postgres"
  13. matrix_postgres_data_path: "{{ matrix_postgres_base_path }}/data"
  14. # matrix_postgres_systemd_services_to_stop_for_maintenance_list specifies the list of systemd services to stop before vacuuming or upgrading.
  15. # These services will be restarted after the operation completes.
  16. matrix_postgres_systemd_services_to_stop_for_maintenance_list: []
  17. matrix_postgres_architecture: amd64
  18. # matrix_postgres_docker_image_suffix controls whether we use Alpine-based images (`-alpine`) or the normal Debian-based images.
  19. # 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).
  20. # On ARM32, `-alpine` images fail with the following error:
  21. # > LOG: startup process (PID 37) was terminated by signal 11: Segmentation fault
  22. matrix_postgres_docker_image_suffix: "{{ '-alpine' if matrix_postgres_architecture in ['amd64', 'arm64'] else '' }}"
  23. matrix_postgres_docker_image_v9: "{{ matrix_container_global_registry_prefix }}postgres:9.6.24{{ matrix_postgres_docker_image_suffix }}"
  24. matrix_postgres_docker_image_v10: "{{ matrix_container_global_registry_prefix }}postgres:10.22{{ matrix_postgres_docker_image_suffix }}"
  25. matrix_postgres_docker_image_v11: "{{ matrix_container_global_registry_prefix }}postgres:11.17{{ matrix_postgres_docker_image_suffix }}"
  26. matrix_postgres_docker_image_v12: "{{ matrix_container_global_registry_prefix }}postgres:12.12{{ matrix_postgres_docker_image_suffix }}"
  27. matrix_postgres_docker_image_v13: "{{ matrix_container_global_registry_prefix }}postgres:13.8{{ matrix_postgres_docker_image_suffix }}"
  28. matrix_postgres_docker_image_v14: "{{ matrix_container_global_registry_prefix }}postgres:14.5{{ matrix_postgres_docker_image_suffix }}"
  29. matrix_postgres_docker_image_v15: "{{ matrix_container_global_registry_prefix }}postgres:15.0{{ matrix_postgres_docker_image_suffix }}"
  30. matrix_postgres_docker_image_latest: "{{ matrix_postgres_docker_image_v15 }}"
  31. # This variable is assigned at runtime. Overriding its value has no effect.
  32. matrix_postgres_docker_image_to_use: '{{ matrix_postgres_docker_image_latest }}'
  33. matrix_postgres_docker_image_force_pull: "{{ matrix_postgres_docker_image_to_use.endswith(':latest') }}"
  34. # A list of extra arguments to pass to the container
  35. matrix_postgres_container_extra_arguments: []
  36. # A list of extra arguments to pass to the postgres process
  37. # e.g. "-c 'max_connections=200'"
  38. matrix_postgres_process_extra_arguments: []
  39. # Controls whether the matrix-postgres container exposes a port (tcp/5432 in the
  40. # container) that can be used to access the database from outside the container (e.g. with psql)
  41. #
  42. # psql postgresql://username:password@localhost:<port>/database_name
  43. #
  44. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:5432"), or empty string to not expose.
  45. matrix_postgres_container_postgres_bind_port: ""
  46. # A list of additional (databases and their credentials) to create.
  47. #
  48. # Example:
  49. # matrix_postgres_additional_databases:
  50. # - name: matrix_appservice_discord
  51. # username: matrix_appservice_discord
  52. # password: some_password
  53. # - name: matrix_appservice_slack
  54. # username: matrix_appservice_slack
  55. # password: some_password
  56. matrix_postgres_additional_databases: []
  57. # A list of roles/users to avoid creating when importing (or upgrading) the database.
  58. # If a dump file contains the roles and they've also been created beforehand (see `matrix_postgres_additional_databases`),
  59. # importing would fail.
  60. # We either need to not create them or to ignore the `CREATE ROLE` statements in the dump.
  61. matrix_postgres_import_roles_to_ignore: |
  62. {{
  63. (
  64. [matrix_postgres_connection_username]
  65. +
  66. matrix_postgres_additional_databases|map(attribute='username') | list
  67. ) | unique
  68. }}
  69. # When importing an existing Postgres database (when restoring a backup) or when doing a Postgres upgrade (which dumps & restores), we'd like to avoid:
  70. # - creating users (`CREATE ROLE ..`)
  71. # - updating passwords for users (`ALTER ROLE matrix WITH SUPERUSER INHERIT NOCREATEROLE NOCREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5...`)
  72. #
  73. # Both of these operations are done by the playbook anyway.
  74. # Updating passwords is especially undesirable, because older versions hash passwords using md5 and export them as md5 hashes in the dump file,
  75. # which is unsupported by default by newer Postgres versions (v14+).
  76. # When users are created and passwords are set by the playbook, they end up hashed as `scram-sha-256` on Postgres v14+.
  77. # If an md5-hashed password is restored on top, Postgres v14+ will refuse to authenticate users with it by default.
  78. #
  79. # We also allow for the role name to be quoted, which is rare, but might happen for role names which are special keywords (e.g. `default`).
  80. matrix_postgres_import_roles_ignore_regex: "^(CREATE|ALTER) ROLE \\\"?({{ matrix_postgres_import_roles_to_ignore | join('|') }})\\\"?(;| WITH)" # noqa jinja[spacing]
  81. # A list of databases to avoid creating when importing (or upgrading) the database.
  82. # If a dump file contains the databases and they've also been created beforehand (see `matrix_postgres_additional_databases`),
  83. # importing would fail.
  84. # We either need to not create them or to ignore the `CREATE DATABASE` statements in the dump.
  85. matrix_postgres_import_databases_to_ignore: |
  86. {{
  87. (
  88. [matrix_postgres_db_name]
  89. +
  90. matrix_postgres_additional_databases|map(attribute='name') | list
  91. ) | unique
  92. }}
  93. # We also allow for the database name to be quoted, which is rare, but might happen for database names which are special keywords (e.g. `default`).
  94. matrix_postgres_import_databases_ignore_regex: "^CREATE DATABASE \\\"?({{ matrix_postgres_import_databases_to_ignore | join('|') }})\\\"?\\s" # noqa jinja[spacing]
  95. # The number of seconds to wait after starting `matrix-postgres.service`
  96. # and before trying to run queries for creating additional databases/users against it.
  97. #
  98. # For most (subsequent) runs, Postgres would already be running, so no waiting will be happening at all.
  99. #
  100. # On ARM, we wait some more. ARM32 devices are especially known for being slow.
  101. # ARM64 likely don't need such a long delay, but it doesn't hurt too much having it.
  102. matrix_postgres_additional_databases_postgres_start_wait_timeout_seconds: "{{ 45 if matrix_postgres_architecture in ['arm32', 'arm64'] else 15 }}"
  103. matrix_postgres_pgloader_container_image_self_build: false
  104. matrix_postgres_pgloader_container_image_self_build_repo: "https://github.com/illagrenan/pgloader-docker.git"
  105. matrix_postgres_pgloader_container_image_self_build_repo_branch: "v{{ matrix_postgres_pgloader_docker_image_tag }}"
  106. matrix_postgres_pgloader_container_image_self_build_src_path: "{{ matrix_postgres_base_path }}/pgloader-container-src"
  107. # We use illagrenan/pgloader, instead of the more official dimitri/pgloader image,
  108. # because the official one only provides a `latest` tag.
  109. matrix_postgres_pgloader_docker_image: "{{ matrix_postgres_pgloader_docker_image_name_prefix }}illagrenan/pgloader:{{ matrix_postgres_pgloader_docker_image_tag }}"
  110. matrix_postgres_pgloader_docker_image_name_prefix: "{{ 'localhost/' if matrix_postgres_pgloader_container_image_self_build else matrix_container_global_registry_prefix }}"
  111. matrix_postgres_pgloader_docker_image_tag: "3.6.2"
  112. matrix_postgres_pgloader_docker_image_force_pull: "{{ matrix_postgres_pgloader_docker_image.endswith(':latest') }}"