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

59 строки
2.3 KiB

  1. # SPDX-FileCopyrightText: 2019 - 2023 Slavi Pantaleev
  2. # SPDX-FileCopyrightText: 2019 Michael Haak
  3. # SPDX-FileCopyrightText: 2020 Christian Wolf
  4. # SPDX-FileCopyrightText: 2022 Aaron Raimist
  5. # SPDX-FileCopyrightText: 2022 Marko Weltzer
  6. # SPDX-FileCopyrightText: 2022 Sebastian Gumprich
  7. #
  8. # SPDX-License-Identifier: AGPL-3.0-or-later
  9. ---
  10. - name: Fail if Synapse Simple Antispam blocked homeservers is not set
  11. ansible.builtin.fail:
  12. msg: "Synapse Simple Antispam is enabled, but no blocked homeservers have been set in matrix_synapse_ext_spam_checker_synapse_simple_antispam_config_blocked_homeservers"
  13. when: "matrix_synapse_ext_spam_checker_synapse_simple_antispam_config_blocked_homeservers | length == 0"
  14. - name: Ensure git installed
  15. ansible.builtin.package:
  16. name: git
  17. state: present
  18. # A checkout owned by a different user (a uid change, an earlier clone by another user, etc.) would make the git task below fail on ownership or permissions.
  19. - name: Ensure synapse-simple-antispam repository ownership is correct
  20. ansible.builtin.file:
  21. path: "{{ matrix_synapse_ext_path }}/synapse-simple-antispam"
  22. state: directory
  23. owner: "{{ matrix_synapse_uid }}"
  24. group: "{{ matrix_synapse_gid }}"
  25. recurse: true
  26. - name: Clone synapse-simple-antispam git repository
  27. ansible.builtin.git:
  28. repo: "{{ matrix_synapse_ext_spam_checker_synapse_simple_antispam_git_repository_url }}"
  29. version: "{{ matrix_synapse_ext_spam_checker_synapse_simple_antispam_git_version }}"
  30. dest: "{{ matrix_synapse_ext_path }}/synapse-simple-antispam"
  31. force: "yes"
  32. become: true
  33. become_user: "{{ matrix_synapse_username }}"
  34. - ansible.builtin.set_fact:
  35. matrix_synapse_modules: >
  36. {{
  37. matrix_synapse_modules
  38. +
  39. [{
  40. "module": "synapse_simple_antispam.AntiSpamInvites",
  41. "config": {
  42. "blocked_homeservers": matrix_synapse_ext_spam_checker_synapse_simple_antispam_config_blocked_homeservers
  43. }
  44. }]
  45. }}
  46. matrix_synapse_container_extra_arguments: >
  47. {{
  48. matrix_synapse_container_extra_arguments | default([])
  49. +
  50. ["--mount type=bind,src=" + matrix_synapse_ext_path + "/synapse-simple-antispam/synapse_simple_antispam,dst=" + matrix_synapse_in_container_python_packages_path + "/synapse_simple_antispam,ro"]
  51. }}