- removed dynamic building of the postgres db list an reused matrix_postgres_additional_databases in group_vars/matrix_servers as source for the list

- adjusted env-postgres-backup.j2 to use the new role specific variables
development
foxcris 4 years ago
parent 604ffe7d79
commit 43f7d9afb6

@ -1419,6 +1419,8 @@ matrix_postgres_backup_connection_port: "{{ matrix_postgres_connection_port }}"
matrix_postgres_backup_connection_username: "{{ matrix_postgres_connection_username }}"
matrix_postgres_backup_connection_password: "{{ matrix_postgres_connection_password }}"
matrix_postgres_backup_db_list: "{{ matrix_postgres_additional_databases|map(attribute='name')|join(', ') }}"
######################################################################
#
# /matrix-postgres-backup

@ -5,6 +5,8 @@ matrix_postgres_backup_connection_port: 5432
matrix_postgres_backup_connection_username: "matrix"
matrix_postgres_backup_connection_password: ""
matrix_postgres_backup_db_list: ""
matrix_postgres_backup_extra_opts: "-Z9 --schema=public --blobs"
matrix_postgres_backup_schedule: "@daily"
matrix_postgres_backup_keep_days: "7"
@ -17,108 +19,6 @@ matrix_postgres_backup_path: "{{ matrix_base_data_path }}/postgres-backup"
matrix_postgres_base_path: "{{ matrix_base_data_path }}/postgres"
matrix_postgres_data_path: "{{ matrix_postgres_base_path }}/data"
# uses sqlite per default
matrix_postgres_backup_matrix_reminder_bot_enabled: false
matrix_bot_matrix_reminder_bot_database_name: 'matrix_reminder_bot'
# uses sqlite per default
matrix_postgres_backup_matrix_appservice_discord_enabled: false
matrix_appservice_discord_database_name: 'matrix_appservice_discord'
# uses nedb per default
matrix_postgres_backup_matrix_appservice_irc_enabled: false
matrix_appservice_irc_database_name: 'matrix_appservice_irc'
# uses nedb per default
matrix_postgres_backup_matrix_appservice_slack_enabled: false
matrix_appservice_slack_database_name: 'matrix_appservice_slack'
# uses postgres per default
matrix_postgres_backup_matrix_mautrix_facebook_enabled: false
matrix_mautrix_facebook_database_name: 'matrix_mautrix_facebook'
# uses sqlite per default
matrix_postgres_backup_matrix_mautrix_hangouts_enabled: false
matrix_mautrix_hangouts_database_name: 'matrix_mautrix_hangouts'
# uses postgres per default
matrix_postgres_backup_matrix_mautrix_signal_enabled: false
matrix_mautrix_signal_database_name: 'matrix_mautrix_signal'
# uses sqlite per default
matrix_postgres_backup_matrix_mautrix_telegram_enabled: false
matrix_mautrix_telegram_database_name: 'matrix_mautrix_telegram'
# uses sqlite per default
matrix_postgres_backup_matrix_mautrix_whatsapp_enabled: false
matrix_mautrix_whatsapp_database_name: 'matrix_mautrix_whatsapp'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_discord_enabled: false
matrix_mx_puppet_discord_database_name: 'matrix_mx_puppet_discord'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_instagram_enabled: false
matrix_postgres_backup_matrix_mx_puppet_instagram_name: 'matrix_mx_puppet_instagram'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_skype_enabled: false
matrix_mx_puppet_skype_database_name: 'matrix_mx_puppet_skype'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_slack_enabled: false
matrix_mx_puppet_slack_database_name: 'matrix_mx_puppet_slack'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_steam_enabled: false
matrix_mx_puppet_steam_database_name: 'matrix_mx_puppet_steam'
# uses sqlite per default
matrix_postgres_backup_matrix_mx_puppet_twitter_enabled: false
matrix_mx_puppet_twitter_database_name: 'matrix_mx_puppet_twitter'
# uses sqlite per default
matrix_postgres_backup_matrix_dimension_enabled: false
matrix_dimension_database_name: 'matrix_dimension'
# uses sqlite per default
matrix_postgres_backup_matrix_etherpad_enabled: false
matrix_etherpad_database_name: 'matrix_etherpad'
# uses sqlite per default
matrix_postgres_backup_matrix_ma1sd_enabled: false
matrix_ma1sd_database_name: 'matrix_ma1sd'
# uses sqlite per default
matrix_postgres_backup_matrix_registration_enabled: false
matrix_registration_database_engine: 'matrix_registration'
# uses postgres per default
matrix_postgres_backup_matrix_synapse_enabled: true
matrix_postgres_db_name: 'matrix'
matrix_postgres_backup_db_dict:
- { enabled: '{{matrix_postgres_backup_matrix_reminder_bot_enabled|bool}}' , dbname: '{{ matrix_bot_matrix_reminder_bot_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_appservice_discord_enabled|bool}}' , dbname: '{{ matrix_appservice_discord_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_appservice_irc_enabled|bool}}' , dbname: '{{ matrix_appservice_irc_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_appservice_slack_enabled|bool}}' , dbname: '{{ matrix_appservice_slack_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mautrix_facebook_enabled|bool}}' , dbname: '{{ matrix_mautrix_facebook_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mautrix_hangouts_enabled|bool}}' , dbname: '{{ matrix_mautrix_hangouts_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mautrix_signal_enabled|bool}}' , dbname: '{{ matrix_mautrix_signal_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mautrix_telegram_enabled|bool}}' , dbname: '{{ matrix_mautrix_telegram_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mautrix_whatsapp_enabled|bool}}' , dbname: '{{ matrix_mautrix_whatsapp_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mx_puppet_instagram_enabled|bool}}' , dbname: '{{ matrix_postgres_backup_matrix_mx_puppet_instagram_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mx_puppet_skype_enabled|bool}}' , dbname: '{{ matrix_mx_puppet_skype_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mx_puppet_slack_enabled|bool}}' , dbname: '{{ matrix_mx_puppet_slack_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mx_puppet_steam_enabled|bool}}' , dbname: '{{ matrix_mx_puppet_steam_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_mx_puppet_twitter_enabled|bool}}' , dbname: '{{ matrix_mx_puppet_twitter_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_dimension_enabled|bool}}' , dbname: '{{ matrix_dimension_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_etherpad_enabled|bool}}' , dbname: '{{ matrix_etherpad_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_ma1sd_enabled|bool}}' , dbname: '{{ matrix_ma1sd_database_name }}' }
- { enabled: '{{matrix_postgres_backup_matrix_registration_enabled|bool}}' , dbname: '{{ matrix_registration_database_engine }}' }
- { enabled: '{{matrix_postgres_backup_matrix_synapse_enabled|bool}}' , dbname: '{{ matrix_postgres_db_name }}' }
matrix_postgres_backup_architecture: amd64
# matrix_postgres_docker_image_suffix controls whether we use Alpine-based images (`-alpine`) or the normal Debian-based images.

@ -3,7 +3,6 @@
#
# Tasks related to setting up an internal postgres server
#
- import_tasks: "{{ role_path }}/tasks/util/detect_existing_postgres_version.yml"
when: matrix_postgres_enabled|bool
@ -34,10 +33,6 @@
- "{{ matrix_postgres_backup_path }}"
when: matrix_postgres_backup_enabled|bool
#Build database list to backup
- import_tasks: "{{ role_path }}/tasks/build_database_list.yml"
when: matrix_postgres_backup_enabled|bool
- name: Ensure Postgres environment variables file created
template:
src: "{{ role_path }}/templates/{{ item }}.j2"

@ -15,3 +15,4 @@
- "matrix_postgres_backup_keep_weeks"
- "matrix_postgres_backup_keep_months"
- "matrix_postgres_backup_path"
- "matrix_postgres_backup_db_list"

@ -1,7 +1,7 @@
#jinja2: lstrip_blocks: "True"
POSTGRES_USER={{ matrix_postgres_connection_username }}
POSTGRES_PASSWORD={{ matrix_postgres_connection_password }}
POSTGRES_HOST={{ matrix_postgres_connection_hostname }}
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_db_list }}
POSTGRES_EXTRA_OPTS={{ matrix_postgres_backup_extra_opts }}
SCHEDULE={{ matrix_postgres_backup_schedule }}
@ -9,4 +9,4 @@ BACKUP_KEEP_DAYS={{ matrix_postgres_backup_keep_days }}
BACKUP_KEEP_WEEKS={{ matrix_postgres_backup_keep_weeks }}
BACKUP_KEEP_MONTHS={{ matrix_postgres_backup_keep_months }}
HEALTHCHECK_PORT={{ matrix_postgres_backup_healthcheck_port }}
POSTGRES_PORT={{ matrix_postgres_connection_port }}
POSTGRES_PORT={{ matrix_postgres_backup_connection_port }}
Loading…
Cancel
Save