Matrix Docker Ansible eploy
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 

81 líneas
5.6 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2025 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 MDAD project contributors
  3. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  4. #
  5. # SPDX-License-Identifier: AGPL-3.0-or-later
  6. ---
  7. - name: (Deprecation) Catch and report renamed appservice-irc variables
  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: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  13. with_items:
  14. - {'old': 'matrix_appservice_irc_container_expose_client_server_api_port', 'new': '<superseded by matrix_appservice_irc_container_http_host_bind_port>'}
  15. - {'old': 'matrix_appservice_irc_container_self_build', 'new': 'matrix_appservice_irc_container_image_self_build'}
  16. - {'old': 'matrix_appservice_irc_docker_image_name_prefix', 'new': 'matrix_appservice_irc_container_image_registry_prefix'}
  17. - {'old': 'matrix_appservice_irc_homeserver_media_url', 'new': '<removed; media proxying now uses matrix_appservice_irc_ircService_mediaProxy_publicUrl>'}
  18. - {'old': 'matrix_appservice_irc_docker_image', 'new': 'matrix_appservice_irc_container_image'}
  19. - {'old': 'matrix_appservice_irc_docker_image_force_pull', 'new': 'matrix_appservice_irc_container_image_force_pull'}
  20. - {'old': 'matrix_appservice_irc_docker_image_registry_prefix', 'new': 'matrix_appservice_irc_container_image_registry_prefix'}
  21. - {'old': 'matrix_appservice_irc_docker_image_registry_prefix_upstream', 'new': 'matrix_appservice_irc_container_image_registry_prefix_upstream'}
  22. - {'old': 'matrix_appservice_irc_docker_image_registry_prefix_upstream_default', 'new': 'matrix_appservice_irc_container_image_registry_prefix_upstream_default'}
  23. - {'old': 'matrix_appservice_irc_docker_image_tag', 'new': 'matrix_appservice_irc_container_image_tag'}
  24. - {'old': 'matrix_appservice_irc_docker_repo', 'new': 'matrix_appservice_irc_container_repo'}
  25. - {'old': 'matrix_appservice_irc_docker_repo_version', 'new': 'matrix_appservice_irc_container_repo_version'}
  26. - {'old': 'matrix_appservice_irc_docker_src_files_path', 'new': 'matrix_appservice_irc_container_src_files_path'}
  27. - name: Fail if required appservice-irc settings not defined
  28. ansible.builtin.fail:
  29. msg: >-
  30. You need to define a required configuration setting (`{{ item.name }}`).
  31. when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
  32. with_items:
  33. - {'name': 'matrix_appservice_irc_appservice_token', when: true}
  34. - {'name': 'matrix_appservice_irc_homeserver_url', when: true}
  35. - {'name': 'matrix_appservice_irc_homeserver_token', when: true}
  36. - {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"}
  37. - {'name': 'matrix_appservice_irc_container_network', when: true}
  38. # Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to
  39. # let the playbook run without errors.
  40. #
  41. # Unless the final configuration (`matrix_appservice_irc_configuration`) contains an `ircService` definition,
  42. # we'd fail generating the registration.yaml file with a non-helpful error.
  43. #
  44. # This is a safety check to ensure we fail earlier and in a nicer way.
  45. - name: Fail if no additional configuration provided
  46. ansible.builtin.fail:
  47. msg: >-
  48. Your Appservice IRC configuration is incomplete (lacking an `ircService.servers` configuration).
  49. You need to define one or more servers by either using `matrix_appservice_irc_ircService_servers`
  50. or by extending the base configuration with additional configuration in `matrix_appservice_irc_configuration_extension_yaml`.
  51. Overriding the whole bridge's configuration (`matrix_appservice_irc_configuration`) is yet another possibility.
  52. when: "matrix_appservice_irc_configuration.ircService.servers | length == 0"
  53. - name: Fail if matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not start with a slash
  54. ansible.builtin.fail:
  55. msg: >-
  56. matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must start with a slash (e.g. `/` or `/irc/`).
  57. when: "matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[0] != '/'"
  58. - name: Fail if matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix does not end with a slash
  59. ansible.builtin.fail:
  60. msg: >-
  61. matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix (`{{ matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix }}`) must end with a slash (e.g. `/` or `/irc/`).
  62. when: "matrix_appservice_irc_ircService_mediaProxy_publicUrl_pathPrefix[-1] != '/'"
  63. - when: matrix_appservice_irc_container_labels_traefik_enabled | bool
  64. block:
  65. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  66. # Knowing that the path_prefix does not end with a slash ensures we know how to set these routes up
  67. # without having to do "does it end with a slash" checks elsewhere.
  68. - name: Fail if matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix ends with a slash
  69. ansible.builtin.fail:
  70. msg: >-
  71. matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix (`{{ matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/irc`).
  72. when: "matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix != '/' and matrix_appservice_irc_container_labels_media_proxy_traefik_path_prefix[-1] == '/'"