Connect matrix-synapse-auto-compressor directly to Postgres network, if integrated Postgres is used

This saves us one container network in the ideal case.
This commit is contained in:
Slavi Pantaleev 2024-01-13 20:00:49 +02:00
parent 130f9ad0a3
commit d48a70b052
2 changed files with 7 additions and 9 deletions

View File

@ -4318,10 +4318,7 @@ matrix_synapse_auto_compressor_enabled: false
matrix_synapse_auto_compressor_container_image_self_build: "{{ matrix_architecture not in ['amd64'] }}"
matrix_synapse_auto_compressor_container_additional_networks: |
{{
([devture_postgres_container_network] if devture_postgres_enabled and devture_postgres_container_network != matrix_synapse_auto_compressor_container_network else [])
}}
matrix_synapse_auto_compressor_container_network: "{{ (devture_postgres_container_network if (devture_postgres_enabled and matrix_synapse_auto_compressor_database_hostname == matrix_synapse_database_host and matrix_synapse_database_host == devture_postgres_connection_hostname) else 'matrix-synapse-auto-compressor') }}"
matrix_synapse_auto_compressor_database_username: "{{ matrix_synapse_database_user if matrix_synapse_enabled else '' }}"
matrix_synapse_auto_compressor_database_password: "{{ matrix_synapse_database_password if matrix_synapse_enabled else '' }}"
@ -4329,11 +4326,9 @@ matrix_synapse_auto_compressor_database_hostname: "{{ matrix_synapse_database_ho
matrix_synapse_auto_compressor_database_port: "{{ matrix_synapse_database_port if matrix_synapse_enabled else '5432' }}"
matrix_synapse_auto_compressor_database_name: "{{ matrix_synapse_database_database if matrix_synapse_enabled else '' }}"
matrix_synapse_auto_compressor_systemd_required_services_list: |
matrix_synapse_auto_compressor_systemd_required_services_list_auto: |
{{
['docker.service']
+
([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled else [])
([devture_postgres_identifier ~ '.service'] if (matrix_synapse_auto_compressor_container_network == devture_postgres_container_network) else [])
}}
######################################################################

View File

@ -31,7 +31,10 @@ matrix_synapse_auto_compressor_container_additional_networks: []
matrix_synapse_auto_compressor_container_extra_arguments: []
# List of systemd services that matrix-synapse-auto-compressor.service depends on
matrix_synapse_auto_compressor_systemd_required_services_list: ['docker.service']
matrix_synapse_auto_compressor_systemd_required_services_list: "{{ matrix_synapse_auto_compressor_systemd_required_services_list_default + matrix_synapse_auto_compressor_systemd_required_services_list_auto + matrix_synapse_auto_compressor_systemd_required_services_list_custom }}"
matrix_synapse_auto_compressor_systemd_required_services_list_default: ['docker.service']
matrix_synapse_auto_compressor_systemd_required_services_list_auto: []
matrix_synapse_auto_compressor_systemd_required_services_list_custom: []
# List of systemd services that matrix-synapse-auto-compressor.service wants
matrix_synapse_auto_compressor_systemd_wanted_services_list: []