From 2178f3612f372fe420e6649dd95da6f45195db8c Mon Sep 17 00:00:00 2001 From: foxcris <361299+foxcris@users.noreply.github.com> Date: Mon, 5 Apr 2021 09:05:41 +0200 Subject: [PATCH] - matrix_postgres_backup_databases now uses more simple structure --- group_vars/matrix_servers | 10 ++++------ roles/matrix-postgres-backup/defaults/main.yml | 3 +-- .../templates/env-postgres-backup.j2 | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index b632b0d7d..ec9993339 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -1422,13 +1422,11 @@ matrix_postgres_backup_connection_password: "{{ matrix_postgres_connection_passw # the default matrix synapse databse is not always part of the matrix_postgres_additional_databases variable thus we have to add it if the default database is used matrix_postgres_backup_databases: | {{ - ([{ - 'name': matrix_synapse_database_database, - 'username': matrix_synapse_database_user, - 'password': matrix_synapse_database_password, - }] if (matrix_synapse_enabled and matrix_synapse_database_database == matrix_postgres_db_name and matrix_synapse_database_host == 'matrix-postgres') else []) + ([ + matrix_synapse_database_database, + ] if (matrix_synapse_enabled and matrix_synapse_database_database == matrix_postgres_db_name and matrix_synapse_database_host == 'matrix-postgres') else []) + - matrix_postgres_additional_databases + matrix_postgres_additional_databases|map(attribute='name') }} ###################################################################### diff --git a/roles/matrix-postgres-backup/defaults/main.yml b/roles/matrix-postgres-backup/defaults/main.yml index cfa690a38..2f3dbc9e5 100644 --- a/roles/matrix-postgres-backup/defaults/main.yml +++ b/roles/matrix-postgres-backup/defaults/main.yml @@ -11,9 +11,8 @@ matrix_postgres_backup_keep_days: "7" matrix_postgres_backup_keep_weeks: "4" matrix_postgres_backup_keep_months: "12" matrix_postgres_backup_healthcheck_port: "8080" -matrix_postgres_backup_db_list: "" +matrix_postgres_backup_databases: [] matrix_postgres_backup_path: "{{ matrix_base_data_path }}/postgres-backup" -matrix_postgres_backup_databases: "" matrix_postgres_base_path: "{{ matrix_base_data_path }}/postgres" matrix_postgres_data_path: "{{ matrix_postgres_base_path }}/data" diff --git a/roles/matrix-postgres-backup/templates/env-postgres-backup.j2 b/roles/matrix-postgres-backup/templates/env-postgres-backup.j2 index 979d3762b..5a3a1ffd6 100644 --- a/roles/matrix-postgres-backup/templates/env-postgres-backup.j2 +++ b/roles/matrix-postgres-backup/templates/env-postgres-backup.j2 @@ -2,7 +2,7 @@ POSTGRES_USER={{ matrix_postgres_backup_connection_username }} POSTGRES_PASSWORD={{ matrix_postgres_backup_connection_password }} POSTGRES_HOST={{ matrix_postgres_backup_connection_hostname }} -POSTGRES_DB={{ matrix_postgres_backup_databases|map(attribute='name')|join(', ') }} +POSTGRES_DB={{ matrix_postgres_backup_databases|join(', ') }} POSTGRES_EXTRA_OPTS={{ matrix_postgres_backup_extra_opts }} SCHEDULE={{ matrix_postgres_backup_schedule }} BACKUP_KEEP_DAYS={{ matrix_postgres_backup_keep_days }}