Add matrix_homeserver_implementation, tracking the current homeserver implementation

The goal is to have a single variable which tells us which homeserver
software is in use. Much simpler than having if/elif/elif checks for
variables like (`matrix_synapse_enabled` and `matrix_dendrite_enabled`, etc.)
everywhere.
This commit is contained in:
Slavi Pantaleev
2021-12-17 19:00:17 +02:00
parent 63968cb04f
commit 3cf9f87097
4 changed files with 30 additions and 1 deletions

View File

@ -1,5 +1,16 @@
---
- name: Fail if 0 or more than 1 homeserver implementations enabled
fail:
msg: >-
You have 0 or more than 1 homeserver implementations enabled
({{ matrix_homeserver_enabled_implementations_list|join(', ') }}).
If you have more than 1 implementation enabled, you can disable the unnecessary implementations by adding `matrix_IMPLEMENTATION_enabled: false` to your vars.yml file.
If you have 0 implementations enabled, you can enable one by adding `matrix_IMPLEMENTATION_enabled: false` to your vars.yml file (e.g. `matrix_dendrite_enabled: true`).
when: "matrix_homeserver_enabled_implementations_list|length != 1"
# We generally support Ansible 2.7.1 and above.
- name: Fail if running on Ansible < 2.7.1
fail: