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.
 
 

45 lines
2.9 KiB

  1. # SPDX-FileCopyrightText: 2024 - 2025 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. - name: Fail if required matrix-authentication-service settings not defined
  6. ansible.builtin.fail:
  7. msg: >-
  8. You need to define a required configuration setting (`{{ item.name }}`).
  9. when: "item.when | bool and vars[item.name] | length == 0"
  10. with_items:
  11. - {'name': 'matrix_authentication_service_hostname', when: true}
  12. - {'name': 'matrix_authentication_service_config_database_username', when: true}
  13. - {'name': 'matrix_authentication_service_config_database_password', when: true}
  14. - {'name': 'matrix_authentication_service_config_database_host', when: true}
  15. - {'name': 'matrix_authentication_service_config_database_database', when: true}
  16. - {'name': 'matrix_authentication_service_config_secrets_encryption', when: true}
  17. - {'name': 'matrix_authentication_service_config_matrix_homeserver', when: true}
  18. - {'name': 'matrix_authentication_service_config_matrix_secret', when: true}
  19. - {'name': 'matrix_authentication_service_config_matrix_endpoint', when: true}
  20. - {'name': 'matrix_authentication_service_container_labels_public_main_hostname', when: "{{ matrix_authentication_service_container_labels_traefik_enabled }}"}
  21. - {'name': 'matrix_authentication_service_container_labels_public_compatibility_layer_hostname', when: "{{ matrix_authentication_service_container_labels_public_compatibility_layer_enabled }}"}
  22. - {'name': 'matrix_authentication_service_container_labels_internal_compatibility_layer_entrypoints', when: "{{ matrix_authentication_service_container_labels_internal_compatibility_layer_enabled }}"}
  23. - {'name': 'matrix_authentication_service_config_email_hostname', when: "{{ matrix_authentication_service_config_email_transport == 'smtp' }}"}
  24. - name: Fail if matrix_authentication_service_config_secrets_encryption is not 64 characters long
  25. ansible.builtin.fail:
  26. msg: "matrix_authentication_service_config_secrets_encryption must be exactly 64 characters long (preferably generated via `openssl rand -hex 32`)"
  27. when: "matrix_authentication_service_config_secrets_encryption | length != 64"
  28. - name: Fail if matrix_authentication_service_config_email_transport is invalid
  29. ansible.builtin.fail:
  30. msg: "matrix_authentication_service_config_email_transport must be one of: blackhole, smtp, or aws_ses"
  31. when: "matrix_authentication_service_config_email_transport not in ['blackhole', 'smtp', 'aws_ses']"
  32. - name: (Deprecation) Catch and report renamed matrix-authentication-service settings
  33. ansible.builtin.fail:
  34. msg: >-
  35. Your configuration contains a variable, which now has a different name.
  36. Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
  37. when: "item.old in vars"
  38. with_items:
  39. - {'old': 'matrix_authentication_service_container_image_name_prefix', 'new': 'matrix_authentication_service_container_image_registry_prefix'}