Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

58 řádky
2.9 KiB

  1. # SPDX-FileCopyrightText: 2021 - 2023 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. - name: (Deprecation) Catch and report renamed Sygnal settings
  7. ansible.builtin.fail:
  8. msg: >-
  9. Your configuration contains a variable, which now has a different name.
  10. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  11. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  12. with_items:
  13. - {'old': 'matrix_sygnal_docker_image', 'new': 'matrix_sygnal_container_image'}
  14. - {'old': 'matrix_sygnal_docker_image_force_pull', 'new': 'matrix_sygnal_container_image_force_pull'}
  15. - {'old': 'matrix_sygnal_docker_image_registry_prefix', 'new': 'matrix_sygnal_container_image_registry_prefix'}
  16. - {'old': 'matrix_sygnal_docker_image_registry_prefix_upstream', 'new': 'matrix_sygnal_container_image_registry_prefix_upstream'}
  17. - {'old': 'matrix_sygnal_docker_image_registry_prefix_upstream_default', 'new': 'matrix_sygnal_container_image_registry_prefix_upstream_default'}
  18. - {'old': 'matrix_sygnal_docker_image_tag', 'new': 'matrix_sygnal_container_image_tag'}
  19. - name: Fail if required Sygnal settings not defined
  20. ansible.builtin.fail:
  21. msg: >
  22. You need to define a required configuration setting (`{{ item }}`).
  23. when: "lookup('vars', item, default='') == ''"
  24. with_items:
  25. - matrix_sygnal_hostname
  26. - matrix_sygnal_path_prefix
  27. - matrix_sygnal_container_network
  28. - when: matrix_sygnal_container_labels_traefik_enabled | bool
  29. block:
  30. - name: Fail if required Sygnal Traefik settings not defined
  31. ansible.builtin.fail:
  32. msg: >-
  33. You need to define a required configuration setting (`{{ item }}`).
  34. when: "lookup('vars', item, default='') == ''"
  35. with_items:
  36. - matrix_sygnal_container_labels_traefik_hostname
  37. - matrix_sygnal_container_labels_traefik_path_prefix
  38. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  39. # Knowing that `matrix_sygnal_container_labels_traefik_path_prefix` does not end with a slash
  40. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  41. - name: Fail if matrix_sygnal_container_labels_traefik_path_prefix ends with a slash
  42. ansible.builtin.fail:
  43. msg: >-
  44. matrix_sygnal_container_labels_traefik_path_prefix (`{{ matrix_sygnal_container_labels_traefik_path_prefix }}`) must either be `/` or not end with a slash (e.g. `/sygnal`).
  45. when: "matrix_sygnal_container_labels_traefik_path_prefix != '/' and matrix_sygnal_container_labels_traefik_path_prefix[-1] == '/'"
  46. - name: Fail if no Sygnal apps defined
  47. ansible.builtin.fail:
  48. msg: >-
  49. Enabling Sygnal requires that you specify at least one app in `matrix_sygnal_apps`
  50. when: "matrix_sygnal_apps | length == 0"