Matrix Docker Ansible eploy
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

59 行
3.1 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. - {'old': 'matrix_sygnal_container_image_force_pull', 'new': '<removed> (the new community.docker.docker_image_pull module handles this natively)'}
  20. - name: Fail if required Sygnal settings not defined
  21. ansible.builtin.fail:
  22. msg: >
  23. You need to define a required configuration setting (`{{ item }}`).
  24. when: "lookup('vars', item, default='') == ''"
  25. with_items:
  26. - matrix_sygnal_hostname
  27. - matrix_sygnal_path_prefix
  28. - matrix_sygnal_container_network
  29. - when: matrix_sygnal_container_labels_traefik_enabled | bool
  30. block:
  31. - name: Fail if required Sygnal Traefik settings not defined
  32. ansible.builtin.fail:
  33. msg: >-
  34. You need to define a required configuration setting (`{{ item }}`).
  35. when: "lookup('vars', item, default='') == ''"
  36. with_items:
  37. - matrix_sygnal_container_labels_traefik_hostname
  38. - matrix_sygnal_container_labels_traefik_path_prefix
  39. # We ensure it doesn't end with a slash, because we handle both (slash and no-slash).
  40. # Knowing that `matrix_sygnal_container_labels_traefik_path_prefix` does not end with a slash
  41. # ensures we know how to set these routes up without having to do "does it end with a slash" checks elsewhere.
  42. - name: Fail if matrix_sygnal_container_labels_traefik_path_prefix ends with a slash
  43. ansible.builtin.fail:
  44. msg: >-
  45. 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`).
  46. when: "matrix_sygnal_container_labels_traefik_path_prefix != '/' and matrix_sygnal_container_labels_traefik_path_prefix[-1] == '/'"
  47. - name: Fail if no Sygnal apps defined
  48. ansible.builtin.fail:
  49. msg: >-
  50. Enabling Sygnal requires that you specify at least one app in `matrix_sygnal_apps`
  51. when: "matrix_sygnal_apps | length == 0"