Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

100 строки
7.2 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', 'conduwuit']"
  6. - name: (Deprecation) Catch and report renamed settings
  7. ansible.builtin.fail:
  8. msg: >-
  9. Your configuration contains a variable, which now has a different name.
  10. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  11. when: "item.old in vars"
  12. with_items:
  13. - {'old': 'host_specific_hostname_identity', 'new': 'matrix_domain'}
  14. - {'old': 'hostname_identity', 'new': 'matrix_domain'}
  15. - {'old': 'hostname_matrix', 'new': 'matrix_server_fqn_matrix'}
  16. - {'old': 'hostname_riot', 'new': 'matrix_server_fqn_element'}
  17. - {'old': 'matrix_server_fqn_riot', 'new': 'matrix_server_fqn_element'}
  18. - {'old': 'matrix_local_bin_path', 'new': '<there is no global bin path anymore - each role has its own>'}
  19. - {'old': 'matrix_client_element_e2ee_default', 'new': 'matrix_static_files_file_matrix_client_property_io_element_e2ee_default'}
  20. - {'old': 'matrix_client_element_e2ee_secure_backup_required', 'new': 'matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_required'}
  21. - {'old': 'matrix_client_element_e2ee_secure_backup_setup_methods', 'new': 'matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_setup_methods'}
  22. # We have a dedicated check for this variable, because we'd like to have a custom (friendlier) message.
  23. - name: Fail if matrix_homeserver_generic_secret_key is undefined
  24. ansible.builtin.fail:
  25. msg: |
  26. The `matrix_homeserver_generic_secret_key` variable must be defined and have a non-null and non-empty value.
  27. If you're observing this error on a new installation, you should ensure that the `matrix_homeserver_generic_secret_key` is defined.
  28. If you think you've defined it, but are still getting this error, then it's likely that you have a typo
  29. in your domain name in `inventory/hosts` or in one of the directories leading up to your `inventory/host_vars/matrix.example.com/vars.yml` file.
  30. If you're observing this error on an existing homeserver installation, you can fix it easily and in a backward-compatible way by adding
  31. `{% raw %}matrix_homeserver_generic_secret_key: "{{ matrix_synapse_macaroon_secret_key }}"{% endraw %}`
  32. to your `vars.yml` file. Using another secret value for the new variable is also possible and shouldn't cause any trouble.
  33. when: "matrix_homeserver_generic_secret_key is none or matrix_homeserver_generic_secret_key == ''"
  34. - name: Fail if required variables are undefined
  35. ansible.builtin.fail:
  36. msg: "The `{{ item.var }}` variable must be defined and have a non-null and non-empty value"
  37. with_items:
  38. - {'var': matrix_domain, 'value': "{{ matrix_domain | default('') }}"}
  39. - {'var': matrix_server_fqn_matrix, 'value': "{{ matrix_server_fqn_matrix | default('') }}"}
  40. - {'var': matrix_server_fqn_element, 'value': "{{ matrix_server_fqn_element | default('') }}"}
  41. - {'var': matrix_homeserver_container_client_api_endpoint, 'value': "{{ matrix_homeserver_container_client_api_endpoint | default('') }}"}
  42. - {'var': matrix_homeserver_container_federation_api_endpoint, 'value': "{{ matrix_homeserver_container_federation_api_endpoint | default('') }}"}
  43. - {'var': matrix_architecture, 'value': "{{ matrix_architecture | default('') }}"}
  44. when: "item.value is none or item.value == ''"
  45. - name: Fail if matrix_architecture is set incorrectly
  46. ansible.builtin.fail:
  47. msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}."
  48. when: matrix_architecture not in ['amd64', 'arm32', 'arm64']
  49. - name: Fail if matrix_playbook_reverse_proxy_type is set incorrectly
  50. ansible.builtin.fail:
  51. msg: |
  52. You have not explicitly specified the type of reverse-proxy you'd like to use (with a `matrix_playbook_reverse_proxy_type` variable in your configuration).
  53. The playbook used to default to nginx (matrix-nginx-proxy), but things are changing with Traefik being the new default reverse-proxy.
  54. Learn more here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#traefik-is-the-default-reverse-proxy-now
  55. when: matrix_playbook_reverse_proxy_type == ''
  56. - name: Fail if matrix_playbook_reverse_proxy_type is set incorrectly
  57. ansible.builtin.fail:
  58. msg: "Detected that variable matrix_playbook_reverse_proxy_type (current value: `{{ matrix_playbook_reverse_proxy_type }}`) appears to be set incorrectly. See roles/custom/matrix-base/defaults/main.yml for valid choices."
  59. when: matrix_playbook_reverse_proxy_type not in ['playbook-managed-traefik', 'other-traefik-container', 'none']
  60. - name: Fail if uppercase domain used
  61. ansible.builtin.fail:
  62. msg: "Detected that you're using an uppercase domain name - `{{ item }}`. This will cause trouble. Please use all-lowercase!"
  63. with_items:
  64. - "{{ matrix_domain }}"
  65. - "{{ matrix_server_fqn_matrix }}"
  66. - "{{ matrix_server_fqn_element }}"
  67. when: "item != item | lower"
  68. - name: Fail if encountering usage of removed role (mx-puppet-skype)
  69. ansible.builtin.fail:
  70. msg: >-
  71. Your configuration seems to include a reference to `matrix_mx_puppet_skype_enabled`. Are you trying to install the mx-puppet-skype bridge?
  72. 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.
  73. To get rid of this error, remove all `matrix_mx_puppet_*` references from your configuration.
  74. 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.
  75. If you still need bridging to Skype, consider switching to the go-skype bridge instead. See `docs/configuring-playbook-bridge-go-skype-bridge.md`.
  76. when: "'matrix_mx_puppet_skype_enabled' in vars"
  77. - name: Fail if mautrix-instagram and mautrix-meta-instagram are in conflict
  78. ansible.builtin.fail:
  79. msg: >-
  80. Your configuration enables both the old mautrix-instagram bridge and the new mautrix-meta-instagram bridge.
  81. By default, both bridges are configured to use the same bridge bot username (`@{{ matrix_mautrix_meta_instagram_appservice_username }}:{{ matrix_domain }}`) which is a conflict.
  82. We recommend that you disable at least one of the bridges (preferrably the old mautrix-instagram bridge), or to resolve the conflict in another way.
  83. To resolve the conflict without disabling a bridge, consider adjusting one of `matrix_mautrix_instagram_appservice_bot_username` or `matrix_mautrix_meta_instagram_appservice_username` - they both have a value of {{ matrix_mautrix_meta_instagram_appservice_username }} right now.
  84. when:
  85. - matrix_mautrix_instagram_enabled | bool
  86. - matrix_mautrix_meta_instagram_enabled | bool
  87. - matrix_mautrix_instagram_appservice_bot_username == matrix_mautrix_meta_instagram_appservice_username