Fail if appservice-discord wants Postgres, but has leftover SQLite data

This commit is contained in:
Slavi Pantaleev
2020-12-14 01:36:15 +02:00
parent dd994995bc
commit b87b754372
2 changed files with 18 additions and 1 deletions

View File

@ -1,5 +1,21 @@
---
- block:
- name: Check if an SQLite database already exists
stat:
path: "{{ matrix_appservice_discord_data_path }}/{{ matrix_appservice_discord_database_filename_name }}"
register: matrix_appservice_discord_stat_sqlite_db
- name: Fail if an SQLite database already exists when using Postgres
fail:
msg: >-
matrix_appservice_discord_database_engine has been set to `postgres` (which is our new default now).
However, we've discovered an existing SQLite database in {{ matrix_appservice_discord_data_path }}/{{ matrix_appservice_discord_database_filename_name }}.
It appears that you've been using this bridge with the SQLite engine until now.
To continue using SQLite, opt into it explicitly: add `matrix_appservice_discord_database_engine: sqlite` to your vars.yml file.
To migrate to Postgres: TODO - migration instructions here.
when: "matrix_appservice_discord_database_engine == 'postgres'"
- name: Ensure Appservice Discord image is pulled
docker_image:
name: "{{ matrix_appservice_discord_docker_image }}"