Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

47 строки
2.7 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: Fail if required appservice-irc settings not defined
  8. ansible.builtin.fail:
  9. msg: >-
  10. You need to define a required configuration setting (`{{ item.name }}`).
  11. when: "item.when | bool and lookup('vars', item.name, default='') | string | length == 0"
  12. with_items:
  13. - {'name': 'matrix_appservice_irc_appservice_token', when: true}
  14. - {'name': 'matrix_appservice_irc_homeserver_url', when: true}
  15. - {'name': 'matrix_appservice_irc_homeserver_token', when: true}
  16. - {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"}
  17. - {'name': 'matrix_appservice_irc_container_network', when: true}
  18. # Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to
  19. # let the playbook run without errors.
  20. #
  21. # Unless the final configuration (`matrix_appservice_irc_configuration`) contains an `ircService` definition,
  22. # we'd fail generating the registration.yaml file with a non-helpful error.
  23. #
  24. # This is a safety check to ensure we fail earlier and in a nicer way.
  25. - name: Fail if no additional configuration provided
  26. ansible.builtin.fail:
  27. msg: >-
  28. Your Appservice IRC configuration is incomplete (lacking an `ircService.servers` configuration).
  29. You need to define one or more servers by either using `matrix_appservice_irc_ircService_servers`
  30. or by extending the base configuration with additional configuration in `matrix_appservice_irc_configuration_extension_yaml`.
  31. Overriding the whole bridge's configuration (`matrix_appservice_irc_configuration`) is yet another possibility.
  32. when: "matrix_appservice_irc_configuration.ircService.servers | length == 0"
  33. - name: (Deprecation) Catch and report renamed appservice-irc variables
  34. ansible.builtin.fail:
  35. msg: >-
  36. Your configuration contains a variable, which now has a different name.
  37. Please rename the variable (`{{ item.old }}` -> `{{ item.new }}`) on your configuration file (vars.yml).
  38. when: "lookup('ansible.builtin.varnames', ('^' + item.old + '$'), wantlist=True) | length > 0"
  39. with_items:
  40. - {'old': 'matrix_appservice_irc_container_expose_client_server_api_port', 'new': '<superseded by matrix_appservice_irc_container_http_host_bind_port>'}
  41. - {'old': 'matrix_appservice_irc_container_self_build', 'new': 'matrix_appservice_irc_container_image_self_build'}
  42. - {'old': 'matrix_appservice_irc_docker_image_name_prefix', 'new': 'matrix_appservice_irc_docker_image_registry_prefix'}