Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
2.1 KiB

  1. ---
  2. - name: Fail if required appservice-irc settings not defined
  3. ansible.builtin.fail:
  4. msg: >-
  5. You need to define a required configuration setting (`{{ item.name }}`).
  6. when: "item.when | bool and vars[item.name] == ''"
  7. with_items:
  8. - {'name': 'matrix_appservice_irc_appservice_token', when: true}
  9. - {'name': 'matrix_appservice_irc_homeserver_token', when: true}
  10. - {'name': 'matrix_appservice_irc_database_hostname', when: "{{ matrix_appservice_irc_database_engine == 'postgres' }}"}
  11. - {'name': 'matrix_appservice_irc_container_network', when: true}
  12. # Our base configuration (`matrix_appservice_irc_configuration_yaml`) is not enough to
  13. # let the playbook run without errors.
  14. #
  15. # Unless the final configuration (`matrix_appservice_irc_configuration`) contains an `ircService` definition,
  16. # we'd fail generating the registration.yaml file with a non-helpful error.
  17. #
  18. # This is a safety check to ensure we fail earlier and in a nicer way.
  19. - name: Fail if no additional configuration provided
  20. ansible.builtin.fail:
  21. msg: >-
  22. Your Appservice IRC configuration is incomplete (lacking an `ircService.servers` configuration).
  23. You need to define one or more servers by either using `matrix_appservice_irc_ircService_servers`
  24. or by extending the base configuration with additional configuration in `matrix_appservice_irc_configuration_extension_yaml`.
  25. Overriding the whole bridge's configuration (`matrix_appservice_irc_configuration`) is yet another possibility.
  26. when: "matrix_appservice_irc_configuration.ircService.servers | length == 0"
  27. - name: (Deprecation) Catch and report renamed appservice-irc variables
  28. ansible.builtin.fail:
  29. msg: >-
  30. Your configuration contains a variable, which now has a different name.
  31. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  32. when: "item.old in vars"
  33. with_items:
  34. - {'old': 'matrix_appservice_irc_container_expose_client_server_api_port', 'new': '<superseded by matrix_appservice_irc_container_http_host_bind_port>'}
  35. - {'old': 'matrix_appservice_irc_container_self_build', 'new': 'matrix_appservice_irc_container_image_self_build'}