Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 

92 рядки
5.6 KiB

  1. ---
  2. - name: Fail if invalid homeserver implementation
  3. ansible.builtin.fail:
  4. msg: "You need to set a valid homeserver implementation in `matrix_homeserver_implementation`"
  5. when: "matrix_homeserver_implementation not in ['synapse', 'dendrite', 'conduit']"
  6. # We generally support Ansible 2.7.1 and above.
  7. - name: Fail if running on Ansible < 2.7.1
  8. ansible.builtin.fail:
  9. 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"
  10. when:
  11. - "(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)"
  12. # Though we do not support Ansible 2.9.6 which is buggy
  13. - name: Fail if running on Ansible 2.9.6 on Ubuntu
  14. ansible.builtin.fail:
  15. 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"
  16. when:
  17. - ansible_distribution == 'Ubuntu'
  18. - "ansible_version.major == 2 and ansible_version.minor == 9 and ansible_version.revision == 6"
  19. - name: (Deprecation) Catch and report renamed settings
  20. ansible.builtin.fail:
  21. msg: >-
  22. Your configuration contains a variable, which now has a different name.
  23. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  24. when: "item.old in vars"
  25. with_items:
  26. - {'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'}
  27. - {'old': 'hostname_identity', 'new': 'matrix_domain'}
  28. - {'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}
  29. - {'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'}
  30. - {'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'}
  31. # We have a dedicated check for this variable, because we'd like to have a custom (friendlier) message.
  32. - name: Fail if matrix_homeserver_generic_secret_key is undefined
  33. ansible.builtin.fail:
  34. msg: |
  35. The `matrix_homeserver_generic_secret_key` variable must be defined and have a non-null and non-empty value.
  36. If you're observing this error on a new installation, you should ensure that the `matrix_homeserver_generic_secret_key` is defined.
  37. If you're observing this error on an existing homeserver installation, you can fix it easily and in a backward-compatible way by adding
  38. `{% raw %}matrix_homeserver_generic_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"{% endraw %}`
  39. to your `vars.yml` file. Using another secret value for the new variable is also possible and shouldn't cause any trouble.
  40. when: "matrix_homeserver_generic_secret_key is none or matrix_homeserver_generic_secret_key == ''"
  41. - name: Fail if required variables are undefined
  42. ansible.builtin.fail:
  43. msg: "The `{{ item.var }}` variable must be defined and have a non-null and non-empty value"
  44. with_items:
  45. - {'var': matrix_domain, 'value': "{{ matrix_domain | default('') }}"}
  46. - {'var': matrix_server_fqn_matrix, 'value': "{{ matrix_server_fqn_matrix | default('') }}"}
  47. - {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element | default('') }}"}
  48. - {'var': matrix_homeserver_container_url, 'value': "{{ matrix_homeserver_container_url | default('') }}"}
  49. - {'var': matrix_homeserver_container_federation_url, 'value': "{{ matrix_homeserver_container_federation_url | default('') }}"}
  50. when: "item.value is none or item.value == ''"
  51. - name: Fail if uppercase domain used
  52. ansible.builtin.fail:
  53. msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
  54. with_items:
  55. - "{{ matrix_domain }}"
  56. - "{{ matrix_server_fqn_matrix }}"
  57. - "{{ matrix_server_fqn_element }}"
  58. when: "item != item | lower"
  59. - name: Fail if using python2 on Archlinux
  60. ansible.builtin.fail:
  61. msg: "Detected that you're using python2 when installing onto Archlinux. Archlinux by default only supports python3."
  62. when:
  63. - ansible_distribution == 'Archlinux'
  64. - ansible_python.version.major != 3
  65. - name: Fail if architecture is set incorrectly
  66. ansible.builtin.fail:
  67. msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
  68. when: (ansible_architecture == "x86_64" and matrix_architecture != "amd64") or
  69. (ansible_architecture == "aarch64" and matrix_architecture != "arm64") or
  70. (ansible_architecture.startswith("armv") and matrix_architecture != "arm32")
  71. - name: Fail if encountering usage of removed role (mx-puppet-skype)
  72. ansible.builtin.fail:
  73. msg: >-
  74. Your configuration seems to include a reference to `matrix_mx_puppet_skype_enabled`. Are you trying to install the mx-puppet-skype bridge?
  75. The playbook no longer includes a role for installing mx-puppet-skype, because the mx-puppet-bridge is unmaintained and has been reported as broken for a long time.
  76. To get rid of this error, remove all `matrix_mx_puppet_*` references from your configuration.
  77. To clean up your server from mx-puppet-skype's presence, see this changelog entry: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#mx-puppet-skype-removal.
  78. If you still need bridging to Skype, consider switching to the go-skype bridge instead. See `docs/configuring-playbook-bridge-go-skype-bridge.md`.
  79. when: "'matrix_mx_puppet_skype_enabled' in vars"