2018-12-23 19:14:01 +02:00
---
2021-12-23 16:28:34 +02:00
- name : Fail if invalid homeserver implementation
2021-12-17 19:00:17 +02:00
fail :
2021-12-23 16:28:34 +02:00
msg : "You need to set a valid homeserver implementation in `matrix_homeserver_implementation`"
when : "matrix_homeserver_implementation not in ['synapse', 'dendrite']"
2021-12-17 19:00:17 +02:00
2021-01-03 08:53:54 +02:00
# We generally support Ansible 2.7.1 and above.
- name : Fail if running on Ansible < 2.7.1
2019-01-03 16:15:47 +02:00
fail :
2020-09-29 11:23:39 +02:00
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"
2021-01-03 08:53:54 +02:00
when :
- "(ansible_version.major < 2) or (ansible_version.major == 2 and ansible_version.minor < 7) or (ansible_version.major == 2 and ansible_version.minor == 7 and ansible_version.revision < 1)"
2019-01-03 16:15:47 +02:00
2020-12-27 04:13:49 +02:00
# Though we do not support Ansible 2.9.6 which is buggy
- name : Fail if running on Ansible 2.9.6 on Ubuntu
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"
when :
- ansible_distribution == 'Ubuntu'
2021-01-03 08:55:30 +02:00
- "ansible_version.major == 2 and ansible_version.minor == 9 and ansible_version.revision == 6"
2020-12-27 04:13:49 +02:00
2019-02-28 11:51:09 +02:00
- name : (Deprecation) Catch and report renamed settings
fail :
msg : >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when : "item.old in vars"
with_items :
- {'old': 'host_specific_hostname_identity', 'new' : 'matrix_domain' }
- {'old': 'hostname_identity', 'new' : 'matrix_domain' }
- {'old': 'hostname_matrix', 'new' : 'matrix_server_fqn_matrix' }
2020-07-17 10:31:20 +02:00
- {'old': 'hostname_riot', 'new' : 'matrix_server_fqn_element' }
- {'old': 'matrix_server_fqn_riot', 'new' : 'matrix_server_fqn_element' }
2019-02-28 11:51:09 +02:00
2022-01-07 16:00:42 +02:00
# We have a dedicated check for this variable, because we'd like to have a custom (friendlier) message.
- name : Fail if matrix_homeserver_generic_secret_key is undefined
fail :
msg : |
The `matrix_homeserver_generic_secret_key` variable must be defined and have a non-null and non-empty value.
2022-01-07 12:40:56 +02:00
If you're observing this error on a new installation, you should ensure that the `matrix_homeserver_generic_secret_key` is defined.
If you're observing this error on an existing homeserver installation, you can fix it easily and in a backward-compatible way by adding
2022-01-07 16:00:42 +02:00
`{% raw %}matrix_homeserver_generic_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"{% endraw %}`
2022-01-07 12:40:56 +02:00
to your `vars.yml` file. Using another secret value for the new variable is also possible and shouldn't cause any trouble.
2022-01-07 16:00:42 +02:00
when : "matrix_homeserver_generic_secret_key is none or matrix_homeserver_generic_secret_key == ''"
2019-02-28 11:51:09 +02:00
- name : Fail if required variables are undefined
fail :
2022-01-07 16:00:42 +02:00
msg : "The `{{ item.var }}` variable must be defined and have a non-null and non-empty value"
2019-02-28 11:51:09 +02:00
with_items :
2022-01-07 16:00:42 +02:00
- {'var': matrix_domain, 'value' : "{{ matrix_domain|default('') }}" }
- {'var': matrix_server_fqn_matrix, 'value' : "{{ matrix_server_fqn_matrix|default('') }}" }
- {'var': matrix_server_fqn_element, 'value' : "{{ matrix_server_fqn_element|default('') }}" }
2022-01-07 12:40:56 +02:00
- {'var': matrix_homeserver_container_url, 'value' : "{{ matrix_homeserver_container_url|default('') }}" }
- {'var': matrix_homeserver_container_federation_url, 'value' : "{{ matrix_homeserver_container_federation_url|default('') }}" }
2022-01-07 16:00:42 +02:00
when : "item.value is none or item.value == ''"
2019-02-28 11:51:09 +02:00
2018-12-23 19:20:53 +02:00
- 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!"
with_items :
2019-02-28 11:51:09 +02:00
- "{{ matrix_domain }}"
- "{{ matrix_server_fqn_matrix }}"
2020-07-17 10:31:20 +02:00
- "{{ matrix_server_fqn_element }}"
2019-02-28 11:51:09 +02:00
when : "item != item|lower"
2020-03-28 12:39:15 +02:00
- name : Fail if using python2 on Archlinux
fail :
msg : "Detected that you're using python2 when installing onto Archlinux. Archlinux by default only supports python3."
when :
- ansible_distribution == 'Archlinux'
- ansible_python.version.major != 3
2021-04-10 23:14:32 +02:00
- name : Fail if architecture is set incorrectly
fail :
msg : "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
when : (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or
(ansible_architecture == "aarch64" and matrix_architecture != "arm64") or
(ansible_architecture.startswith("armv") and matrix_architecture != "arm32")