mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-11-14 10:04:46 +08:00
51312b8250
As suggested in #63 (Github issue), splitting the playbook's logic into multiple roles will be beneficial for maintainability. This patch realizes this split. Still, some components affect others, so the roles are not really independent of one another. For example: - disabling mxisd (`matrix_mxisd_enabled: false`), causes Synapse and riot-web to reconfigure themselves with other (public) Identity servers. - enabling matrix-corporal (`matrix_corporal_enabled: true`) affects how reverse-proxying (by `matrix-nginx-proxy`) is done, in order to put matrix-corporal's gateway server in front of Synapse We may be able to move away from such dependencies in the future, at the expense of a more complicated manual configuration, but it's probably not worth sacrificing the convenience we have now. As part of this work, the way we do "start components" has been redone now to use a loop, as suggested in #65 (Github issue). This should make restarting faster and more reliable.
40 lines
1.7 KiB
YAML
40 lines
1.7 KiB
YAML
---
|
|
|
|
- set_fact:
|
|
matrix_ansible_outdated_fail_msg: "You are running on Ansible {{ ansible_version.string }}, which is not supported. See our guide about Ansible: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/ansible.md"
|
|
|
|
- name: Fail if running on Ansible < 2.4
|
|
fail:
|
|
msg: "{{ matrix_ansible_outdated_fail_msg }}"
|
|
when: "ansible_version.major <= 2 and ansible_version.minor < 4"
|
|
|
|
# Ansible 2.5.0 and 2.5.1 are known to have a bug with `include_tasks` + `with_items`.
|
|
# The bug has been fixed in Ansible 2.5.2.
|
|
- name: Fail if running on Ansible 2.5.x (lower than 2.5.2)
|
|
fail:
|
|
msg: "{{ matrix_ansible_outdated_fail_msg }}"
|
|
when: "ansible_version.major == 2 and ansible_version.minor == 5 and ansible_version.revision < 2"
|
|
|
|
- name: Fail if Macaroon key is missing
|
|
fail:
|
|
msg: "You need to set a secret in the matrix_synapse_macaroon_secret_key variable"
|
|
when: "matrix_synapse_macaroon_secret_key == ''"
|
|
|
|
- name: Fail if Coturn Auth secret is missing
|
|
fail:
|
|
msg: "You need to set a secret in the matrix_coturn_turn_static_auth_secret variable"
|
|
when: "matrix_coturn_turn_static_auth_secret == ''"
|
|
|
|
# This sanity check is only used to detect uppercase when people override these specific variables.
|
|
#
|
|
# If people set `host_specific_hostname_identity` without overriding other variables (the general use-case),
|
|
# we take care to lower-case it automatically and it won't cause trouble anyway.
|
|
- name: Fail if uppercase domain used
|
|
fail:
|
|
msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
|
|
when: "item != item|lower"
|
|
with_items:
|
|
- "{{ hostname_identity }}"
|
|
- "{{ hostname_matrix }}"
|
|
- "{{ hostname_riot }}"
|