Do not introduce sub-variables exposing implementation details

This commit is contained in:
Slavi Pantaleev
2020-12-14 10:51:53 +02:00
parent f1e85f7112
commit d91aa5a060
3 changed files with 26 additions and 22 deletions

View File

@ -70,7 +70,7 @@ matrix_appservice_discord_homeserver_token: "{{ matrix_synapse_macaroon_secret_k
# We only make this use Postgres if our own Postgres server is enabled.
# It's only then (for now) that we can automatically create the necessary database and user for this service.
matrix_appservice_discord_database_engine: "{{ 'postgres' if matrix_postgres_enabled else 'sqlite' }}"
matrix_appservice_discord_database_connString_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'as.discord.db') | to_uuid }}"
matrix_appservice_discord_postgres_password: "{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'as.discord.db') | to_uuid }}"
######################################################################
#
@ -950,10 +950,10 @@ matrix_postgres_db_name: "homeserver"
matrix_postgres_additional_databases: |
{{
([{
'name': matrix_appservice_discord_database_connString_db_name,
'username': matrix_appservice_discord_database_connString_username,
'password': matrix_appservice_discord_database_connString_password,
}] if (matrix_appservice_discord_enabled and matrix_appservice_discord_database_engine == 'postgres' and matrix_appservice_discord_database_connString_hostname == 'matrix-postgres') else [])
'name': matrix_appservice_discord_postgres_db_name,
'username': matrix_appservice_discord_postgres_username,
'password': matrix_appservice_discord_postgres_password,
}] if (matrix_appservice_discord_enabled and matrix_appservice_discord_database_engine == 'postgres' and matrix_appservice_discord_postgres_hostname == 'matrix-postgres') else [])
+ ([{
'name': matrix_appservice_slack_database_db_name
'username': matrix_appservice_slack_database_username