Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

63 行
3.5 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2023 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2019 Dan Arnfield
  3. # SPDX-FileCopyrightText: 2019 Edgars Voroboks
  4. # SPDX-FileCopyrightText: 2020 Chris van Dijk
  5. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  6. # SPDX-FileCopyrightText: 2025 Suguru Hirahara
  7. #
  8. # SPDX-License-Identifier: AGPL-3.0-or-later
  9. ---
  10. - name: Fail if required Dimension settings not defined
  11. ansible.builtin.fail:
  12. msg: >
  13. You need to define a required configuration setting (`{{ item.name }}`).
  14. when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
  15. with_items:
  16. - {'name': 'matrix_dimension_hostname', when: true}
  17. - {'name': 'matrix_dimension_container_network', when: true}
  18. - {'name': 'matrix_dimension_access_token', when: true}
  19. - {'name': 'matrix_dimension_homeserver_clientServerUrl', when: true}
  20. - {'name': 'matrix_dimension_homeserver_federationUrl', when: true}
  21. - {'name': 'matrix_dimension_homeserver_mediaUrl', when: true}
  22. - {'name': 'matrix_dimension_database_hostname', when: "{{ matrix_dimension_database_engine == 'postgres' }}"}
  23. - name: (Deprecation) Catch and report renamed Dimension variables
  24. ansible.builtin.fail:
  25. msg: >-
  26. Your configuration contains a variable, which now has a different name.
  27. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  28. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  29. with_items:
  30. - {'old': 'matrix_dimension_container_expose_port', 'new': '<superseded by matrix_dimension_container_http_host_bind_port>'}
  31. - {'old': 'matrix_dimension_container_image_name_prefix', 'new': 'matrix_dimension_docker_image_registry_prefix'}
  32. - when: matrix_dimension_container_labels_traefik_enabled | bool
  33. block:
  34. - name: Fail if required Dimension Traefik settings not defined
  35. ansible.builtin.fail:
  36. msg: >-
  37. You need to define a required configuration setting (`{{ item }}`).
  38. when: "lookup('vars', item, default='') == ''"
  39. with_items:
  40. - matrix_dimension_container_labels_traefik_hostname
  41. - matrix_dimension_container_labels_traefik_path_prefix
  42. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  43. # Knowing that `matrix_dimension_container_labels_traefik_path_prefix` does not end with a slash
  44. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  45. - name: Fail if matrix_dimension_container_labels_traefik_path_prefix ends with a slash
  46. ansible.builtin.fail:
  47. msg: >-
  48. matrix_dimension_container_labels_traefik_path_prefix (`{{ matrix_dimension_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/dimension`).
  49. when: "matrix_dimension_container_labels_traefik_path_prefix != '/' and matrix_dimension_container_labels_traefik_path_prefix[-1] == '/'"
  50. - name: Fail if matrix_dimension_container_labels_traefik_path_prefix is not /
  51. ansible.builtin.fail:
  52. msg: >-
  53. matrix_dimension_container_labels_traefik_path_prefix (`{{ matrix_dimension_container_labels_traefik_path_prefix }}`) must currently be set to `/`.
  54. Other values are not supported.
  55. See: https://github.com/turt2live/matrix-dimension/issues/510
  56. when: "matrix_dimension_container_labels_traefik_path_prefix != '/' and matrix_dimension_container_labels_traefik_path_prefix[-1] == '/'"