Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

71 lines
4.5 KiB

  1. # SPDX-FileCopyrightText: 2023 - 2025 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2023 - 2025 Catalan Lover <catalanlover@protonmail.com>
  3. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. - name: (Deprecation) Catch and report renamed Draupnir settings
  8. ansible.builtin.fail:
  9. msg: >-
  10. Your configuration contains a variable, which now has a different name.
  11. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  12. when: "item.old in vars"
  13. with_items:
  14. - {'old': 'matrix_bot_draupnir_container_image_name_prefix', 'new': 'matrix_bot_draupnir_container_image_registry_prefix'}
  15. - {'old': 'matrix_bot_draupnir_enable_room_state_backing_store', 'new': 'matrix_bot_draupnir_config_roomStateBackingStore_enabled'}
  16. - {'old': 'matrix_bot_draupnir_disable_server_acl', 'new': 'matrix_bot_draupnir_config_disableServerACL'}
  17. - {'old': 'matrix_bot_draupnir_enable_experimental_rust_crypto', 'new': 'matrix_bot_draupnir_config_experimentalRustCrypto'}
  18. - {'old': 'matrix_bot_draupnir_access_token', 'new': 'matrix_bot_draupnir_config_accessToken'}
  19. - {'old': 'matrix_bot_draupnir_management_room', 'new': 'matrix_bot_draupnir_config_managementRoom'}
  20. - {'old': 'matrix_bot_draupnir_homeserver_url', 'new': 'matrix_bot_draupnir_config_homeserverUrl'}
  21. - {'old': 'matrix_bot_draupnir_raw_homeserver_url', 'new': 'matrix_bot_draupnir_config_rawHomeserverUrl'}
  22. - {'old': 'matrix_bot_draupnir_web_enabled', 'new': 'matrix_bot_draupnir_config_web_enabled'}
  23. - {'old': 'matrix_bot_draupnir_abuse_reporting_enabled', 'new': 'matrix_bot_draupnir_config_web_abuseReporting'}
  24. - {'old': 'matrix_bot_draupnir_display_reports', 'new': 'matrix_bot_draupnir_config_displayReports'}
  25. - name: Fail if required matrix-bot-draupnir variables are undefined
  26. ansible.builtin.fail:
  27. msg: "The `{{ item.name }}` variable must be defined and have a non-null value."
  28. with_items:
  29. - {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ not matrix_bot_draupnir_pantalaimon_use }}"}
  30. - {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ matrix_bot_draupnir_config_experimentalRustCrypto }}"}
  31. - {'name': 'matrix_bot_draupnir_config_managementRoom', when: true}
  32. - {'name': 'matrix_bot_draupnir_container_network', when: true}
  33. - {'name': 'matrix_bot_draupnir_config_homeserverUrl', when: true}
  34. - {'name': 'matrix_bot_draupnir_config_rawHomeserverUrl', when: true}
  35. - {'name': 'matrix_bot_draupnir_pantalaimon_username', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
  36. - {'name': 'matrix_bot_draupnir_pantalaimon_password', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
  37. when: "item.when | bool and (vars[item.name] == '' or vars[item.name] is none)"
  38. - name: Fail if inappropriate variables are defined
  39. ansible.builtin.fail:
  40. msg: "The `{{ item.name }}` variable must be undefined or have a null value."
  41. with_items:
  42. - {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ matrix_bot_draupnir_pantalaimon_use }}"}
  43. - {'name': 'matrix_bot_draupnir_config_accessToken', when: "{{ matrix_bot_draupnir_login_native }}"}
  44. when: "item.when | bool and not (vars[item.name] == '' or vars[item.name] is none)"
  45. - name: Fail when matrix_bot_draupnir_config_experimentalRustCrypto is enabled together with matrix_bot_draupnir_pantalaimon_use
  46. ansible.builtin.fail:
  47. msg: >-
  48. Your configuration is trying to enable matrix_bot_draupnir_config_experimentalRustCrypto and matrix_bot_draupnir_pantalaimon_use at the same time.
  49. These settings are mutually incompatible and therefore cant be used at the same time.
  50. when:
  51. - matrix_bot_draupnir_pantalaimon_use
  52. - matrix_bot_draupnir_config_experimentalRustCrypto
  53. - when: "matrix_bot_draupnir_pantalaimon_use == 'true' and matrix_bot_draupnir_pantalaimon_breakage_ignore == 'false'"
  54. block:
  55. - name: Inject warning if Pantalaimon is used together with Draupnir
  56. ansible.builtin.set_fact:
  57. devture_playbook_runtime_messages_list: |
  58. {{
  59. devture_playbook_runtime_messages_list | default([])
  60. +
  61. [
  62. "Note: Draupnir does not support running with Pantalaimon as it would break all workflows that involve answering prompts with reactions. To enable E2EE for Draupnir, it is recommended to use matrix_bot_draupnir_config_experimentalRustCrypto instead. This warning can be disabled by setting matrix_bot_draupnir_pantalaimon_breakage_ignore to true."
  63. ]
  64. }}