Remove Redis and KeyDB support, only leaving Valkey around

This commit is contained in:
Slavi Pantaleev 2025-01-27 09:54:11 +02:00
parent eaa4e86517
commit 43d5596086
7 changed files with 62 additions and 84 deletions

View File

@ -1,3 +1,26 @@
# 2025-01-27
## Redis and KeyDB are no longer part of the playbook
**TLDR**: The playbook now exclusively uses Valkey as its Redis-compatible memorystore implementation, removing support for Redis and KeyDB. Most users are unaffected by this change unless they explicitly configured Redis or KeyDB variables. Only users that were explicitly definining `redis_*` or `keydb_*` variables will need to update their configuration to use `valkey_*` variables instead.
The playbook has gone through several iterations of memorystore implementations:
1. It initially used Redis, auto-installing it when needed by features/services
2. [Switched to KeyDB](#backward-compatibility-break-the-playbook-now-defaults-to-keydb-instead-of-redis) as the default, while keeping Redis support for those who wished to remain on Redis
3. [Switched to Valkey](#backward-compatibility-break-the-playbook-now-defaults-to-valkey-instead-of-keydb) due to [KeyDB issues](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/3544), while keeping Redis and KeyDB support, for those who wished to remain on them
To reduce configuration complexity and maintenance overhead, we are now:
- removing Redis and KeyDB support entirely
- using Valkey as the sole Redis-compatible memorystore implementation
To update your configuration:
- **Most users** don't need to do anything
- **Users that were explicitly sticking to Redis/KeyDB** need to update their `vars.yml` to use `valkey_*` variables instead
# 2025-01-19 # 2025-01-19
## conduwuit support ## conduwuit support

View File

@ -432,10 +432,6 @@ devture_systemd_service_manager_services_list_auto: |
+ +
([{'name': 'matrix-prometheus-nginxlog-exporter.service', 'priority': 3900, 'groups': ['matrix', 'monitoring', 'prometheus-exporters', 'prometheus-nginxlog-exporter']}] if matrix_prometheus_nginxlog_exporter_enabled else []) ([{'name': 'matrix-prometheus-nginxlog-exporter.service', 'priority': 3900, 'groups': ['matrix', 'monitoring', 'prometheus-exporters', 'prometheus-nginxlog-exporter']}] if matrix_prometheus_nginxlog_exporter_enabled else [])
+ +
([{'name': (redis_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'redis']}] if redis_enabled else [])
+
([{'name': (keydb_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'keydb']}] if keydb_enabled else [])
+
([{'name': (valkey_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'valkey']}] if valkey_enabled else []) ([{'name': (valkey_identifier + '.service'), 'priority': 750, 'groups': ['matrix', 'valkey']}] if valkey_enabled else [])
+ +
([{'name': 'matrix-pantalaimon.service', 'priority': 4000, 'groups': ['matrix', 'pantalaimon']}] if matrix_pantalaimon_enabled else []) ([{'name': 'matrix-pantalaimon.service', 'priority': 4000, 'groups': ['matrix', 'pantalaimon']}] if matrix_pantalaimon_enabled else [])
@ -2215,17 +2211,13 @@ matrix_hookshot_systemd_wanted_services_list: |
{{ {{
matrix_addons_homeserver_systemd_services_list matrix_addons_homeserver_systemd_services_list
+ +
([(redis_identifier + '.service')] if redis_enabled and matrix_hookshot_cache_redis_host == redis_identifier else [])
+
([(keydb_identifier + '.service')] if keydb_enabled and matrix_hookshot_cache_redis_host == keydb_identifier else [])
+
([(valkey_identifier + '.service')] if valkey_enabled and matrix_hookshot_cache_redis_host == valkey_identifier else []) ([(valkey_identifier + '.service')] if valkey_enabled and matrix_hookshot_cache_redis_host == valkey_identifier else [])
}} }}
# Hookshot's experimental encryption feature (and possibly others) may benefit from Redis, if available. # Hookshot's experimental encryption feature (and possibly others) may benefit from Redis, if available.
# We only connect to Redis if encryption is enabled (not for everyone who has Redis enabled), # We only connect to Redis if encryption is enabled (not for everyone who has Redis enabled),
# because connectivity is still potentially troublesome and is to be investigated. # because connectivity is still potentially troublesome and is to be investigated.
matrix_hookshot_cache_redis_host: "{{ valkey_identifier if valkey_enabled else (redis_identifier if redis_enabled else (keydb_identifier if keydb_enabled else '')) }}" matrix_hookshot_cache_redis_host: "{{ valkey_identifier if valkey_enabled else '' }}"
matrix_hookshot_container_network: "{{ matrix_addons_container_network }}" matrix_hookshot_container_network: "{{ matrix_addons_container_network }}"
@ -2234,10 +2226,6 @@ matrix_hookshot_container_additional_networks_auto: |
( (
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network]) ([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
+ +
([redis_container_network] if redis_enabled and matrix_hookshot_cache_redis_host == redis_identifier else [])
+
([keydb_container_network] if keydb_enabled and matrix_hookshot_cache_redis_host == keydb_identifier else [])
+
([valkey_container_network] if valkey_enabled and matrix_hookshot_cache_redis_host == valkey_identifier else []) ([valkey_container_network] if valkey_enabled and matrix_hookshot_cache_redis_host == valkey_identifier else [])
+ +
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network and matrix_hookshot_container_labels_traefik_enabled else []) ([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network and matrix_hookshot_container_labels_traefik_enabled else [])
@ -4411,57 +4399,6 @@ ntfy_visitor_request_limit_exempt_hosts_hostnames_auto: |
# #
###################################################################### ######################################################################
######################################################################
#
# redis
#
######################################################################
redis_enabled: "{{ not (keydb_enabled or valkey_enabled) and (matrix_synapse_workers_enabled or (matrix_hookshot_enabled and matrix_hookshot_encryption_enabled)) }}"
redis_identifier: matrix-redis
redis_uid: "{{ matrix_user_uid }}"
redis_gid: "{{ matrix_user_gid }}"
redis_base_path: "{{ matrix_base_data_path }}/redis"
######################################################################
#
# /redis
#
######################################################################
######################################################################
#
# keydb
#
######################################################################
keydb_enabled: false
keydb_identifier: matrix-keydb
keydb_uid: "{{ matrix_user_uid }}"
keydb_gid: "{{ matrix_user_gid }}"
keydb_base_path: "{{ matrix_base_data_path }}/keydb"
keydb_arch: |-
{{
({
'amd64': 'x86_64',
'arm32': 'arm32',
'arm64': 'arm64',
})[matrix_architecture]
}}
######################################################################
#
# keydb
#
######################################################################
###################################################################### ######################################################################
# #
@ -4705,10 +4642,6 @@ matrix_synapse_container_additional_networks_auto: |
+ +
([postgres_container_network] if (postgres_enabled and postgres_container_network != matrix_synapse_container_network and matrix_synapse_database_host == postgres_connection_hostname) else []) ([postgres_container_network] if (postgres_enabled and postgres_container_network != matrix_synapse_container_network and matrix_synapse_database_host == postgres_connection_hostname) else [])
+ +
([redis_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == redis_identifier else [])
+
([keydb_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == keydb_identifier else [])
+
([valkey_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == valkey_identifier else []) ([valkey_container_network] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == valkey_identifier else [])
+ +
([exim_relay_container_network] if (exim_relay_enabled and matrix_synapse_email_enabled and matrix_synapse_email_smtp_host == exim_relay_identifier and matrix_synapse_container_network != exim_relay_container_network) else []) ([exim_relay_container_network] if (exim_relay_enabled and matrix_synapse_email_enabled and matrix_synapse_email_smtp_host == exim_relay_identifier and matrix_synapse_container_network != exim_relay_container_network) else [])
@ -4794,10 +4727,6 @@ matrix_synapse_systemd_required_services_list_auto: |
{{ {{
([postgres_identifier ~ '.service'] if (postgres_enabled and postgres_container_network != matrix_synapse_container_network and matrix_synapse_database_host == postgres_connection_hostname) else []) ([postgres_identifier ~ '.service'] if (postgres_enabled and postgres_container_network != matrix_synapse_container_network and matrix_synapse_database_host == postgres_connection_hostname) else [])
+ +
([redis_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == redis_identifier else [])
+
([keydb_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == keydb_identifier else [])
+
([valkey_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == valkey_identifier else []) ([valkey_identifier ~ '.service'] if matrix_synapse_redis_enabled and matrix_synapse_redis_host == valkey_identifier else [])
+ +
(['matrix-goofys.service'] if matrix_s3_media_store_enabled else []) (['matrix-goofys.service'] if matrix_s3_media_store_enabled else [])
@ -4813,9 +4742,9 @@ matrix_synapse_systemd_wanted_services_list_auto: |
}} }}
# Synapse workers (used for parallel load-scaling) need Redis for IPC. # Synapse workers (used for parallel load-scaling) need Redis for IPC.
matrix_synapse_redis_enabled: "{{ redis_enabled or keydb_enabled or valkey_enabled }}" matrix_synapse_redis_enabled: "{{ valkey_enabled }}"
matrix_synapse_redis_host: "{{ valkey_identifier if valkey_enabled else (redis_identifier if redis_enabled else (keydb_identifier if keydb_enabled else '')) }}" matrix_synapse_redis_host: "{{ valkey_identifier if valkey_enabled else '' }}"
matrix_synapse_redis_password: "{{ valkey_connection_password if valkey_enabled else (redis_connection_password if redis_enabled else (keydb_connection_password if keydb_enabled else '')) }}" matrix_synapse_redis_password: "{{ valkey_connection_password if valkey_enabled else '' }}"
matrix_synapse_container_extra_arguments_auto: "{{ matrix_homeserver_container_extra_arguments_auto }}" matrix_synapse_container_extra_arguments_auto: "{{ matrix_homeserver_container_extra_arguments_auto }}"
matrix_synapse_app_service_config_files_auto: "{{ matrix_homeserver_app_service_config_files_auto }}" matrix_synapse_app_service_config_files_auto: "{{ matrix_homeserver_app_service_config_files_auto }}"

View File

@ -27,9 +27,6 @@
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-jitsi.git
version: v9955-0 version: v9955-0
name: jitsi name: jitsi
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-keydb.git
version: v6.3.4-3
name: keydb
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git
version: v2.11.0-0 version: v2.11.0-0
name: ntfy name: ntfy
@ -57,9 +54,6 @@
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-prometheus-postgres-exporter.git
version: v0.14.0-6 version: v0.14.0-6
name: prometheus_postgres_exporter name: prometheus_postgres_exporter
- src: git+https://github.com/mother-of-all-self-hosting/ansible-role-redis.git
version: v7.2.5-1
name: redis
- src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git - src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git
version: v1.3.0-0 version: v1.3.0-0
name: systemd_docker_base name: systemd_docker_base

View File

@ -1120,7 +1120,7 @@ matrix_synapse_redis_dbid: 0
# #
# If Redis is available, we prefer to use that, instead of talking over Synapse's custom replication protocol. # If Redis is available, we prefer to use that, instead of talking over Synapse's custom replication protocol.
# #
# matrix_synapse_replication_listener_enabled: "{{ matrix_synapse_workers_enabled and not redis_enabled }}" # matrix_synapse_replication_listener_enabled: "{{ matrix_synapse_workers_enabled and matrix_synapse_redis_enabled }}"
# We force-enable this listener for now until we debug why communication via Redis fails. # We force-enable this listener for now until we debug why communication via Redis fails.
matrix_synapse_replication_listener_enabled: true matrix_synapse_replication_listener_enabled: true

View File

@ -18,6 +18,12 @@ matrix_playbook_migration_matrix_ntfy_migration_validation_enabled: true
# Controls if (`matrix_redis` -> `redis`) validation will run. # Controls if (`matrix_redis` -> `redis`) validation will run.
matrix_playbook_migration_matrix_redis_migration_validation_enabled: true matrix_playbook_migration_matrix_redis_migration_validation_enabled: true
# Controls if (`redis` -> `valkey`) validation will run.
matrix_playbook_migration_redis_valkey_migration_validation_enabled: true
# Controls if (`keydb` -> `valkey`) validation will run.
matrix_playbook_migration_keydb_valkey_migration_validation_enabled: true
# Controls if (`matrix_etherpad` -> `etherpad`) validation will run. # Controls if (`matrix_etherpad` -> `etherpad`) validation will run.
matrix_playbook_migration_matrix_etherpad_migration_validation_enabled: true matrix_playbook_migration_matrix_etherpad_migration_validation_enabled: true

View File

@ -182,6 +182,34 @@
We found usage of the following variables: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }} We found usage of the following variables: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_redis_migration_vars | length > 0" when: "matrix_playbook_migration_redis_migration_vars | length > 0"
- when: matrix_playbook_migration_redis_valkey_migration_validation_enabled | bool
block:
- ansible.builtin.set_fact:
matrix_playbook_migration_redis_migration_vars: |-
{{ vars | dict2items | selectattr('key', 'match', 'redis_.*') | list | items2dict }}
- name: (Deprecation) Catch and report matrix_redis variables
ansible.builtin.fail:
msg: >-
The Redis role that used to be part of this playbook has been superseded by https://github.com/mother-of-all-self-hosting/ansible-role-valkey.
Please change your configuration (vars.yml) to rename all variables (`redis_` -> `valkey_`).
We found usage of the following variables: {{ matrix_playbook_migration_redis_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_redis_migration_vars | length > 0"
- when: matrix_playbook_migration_keydb_valkey_migration_validation_enabled | bool
block:
- ansible.builtin.set_fact:
matrix_playbook_migration_keydb_migration_vars: |-
{{ vars | dict2items | selectattr('key', 'match', 'keydb_.*') | list | items2dict }}
- name: (Deprecation) Catch and report matrix_redis variables
ansible.builtin.fail:
msg: >-
The KeyDB role that used to be part of this playbook has been superseded by https://github.com/mother-of-all-self-hosting/ansible-role-valkey.
Please change your configuration (vars.yml) to rename all variables (`keydb_` -> `valkey_`).
We found usage of the following variables: {{ matrix_playbook_migration_keydb_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_keydb_migration_vars | length > 0"
- when: matrix_playbook_migration_matrix_etherpad_migration_validation_enabled | bool - when: matrix_playbook_migration_matrix_etherpad_migration_validation_enabled | bool
block: block:
- ansible.builtin.set_fact: - ansible.builtin.set_fact:

View File

@ -47,8 +47,6 @@
- role: galaxy/postgres - role: galaxy/postgres
- galaxy/redis
- galaxy/keydb
- galaxy/valkey - galaxy/valkey
- role: custom/matrix-authentication-service - role: custom/matrix-authentication-service