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.
 
 
 

53 lines
2.0 KiB

  1. # SPDX-FileCopyrightText: 2025 MDAD project contributors
  2. # SPDX-FileCopyrightText: 2025 Catalan Lover <catalanlover@protonmail.com>
  3. #
  4. # SPDX-License-Identifier: AGPL-3.0-or-later
  5. ---
  6. - name: Ensure git installed
  7. ansible.builtin.package:
  8. name: git
  9. state: present
  10. # 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.
  11. - name: Ensure synapse-http-antispam repository ownership is correct
  12. ansible.builtin.file:
  13. path: "{{ matrix_synapse_ext_path }}/synapse-http-antispam"
  14. state: directory
  15. owner: "{{ matrix_synapse_uid }}"
  16. group: "{{ matrix_synapse_gid }}"
  17. recurse: true
  18. - name: Clone synapse-http-antispam git repository
  19. ansible.builtin.git:
  20. repo: "{{ matrix_synapse_ext_synapse_http_antispam_git_repository_url }}"
  21. version: "{{ matrix_synapse_ext_synapse_http_antispam_git_version }}"
  22. dest: "{{ matrix_synapse_ext_path }}/synapse-http-antispam"
  23. force: "yes"
  24. become: true
  25. become_user: "{{ matrix_synapse_username }}"
  26. # Keep this even though the task above normalizes ownership. Git may still see an ownership mismatch when Ansible becomes an unprivileged user (see #5065).
  27. environment:
  28. GIT_CONFIG_COUNT: "1"
  29. GIT_CONFIG_KEY_0: safe.directory
  30. GIT_CONFIG_VALUE_0: "{{ matrix_synapse_ext_path }}/synapse-http-antispam"
  31. - ansible.builtin.set_fact:
  32. matrix_synapse_modules: >
  33. {{
  34. matrix_synapse_modules | default([])
  35. +
  36. [{
  37. "module": "synapse_http_antispam.HTTPAntispam",
  38. "config": matrix_synapse_ext_synapse_http_antispam_config,
  39. }]
  40. }}
  41. matrix_synapse_container_extra_arguments: >
  42. {{
  43. matrix_synapse_container_extra_arguments | default([])
  44. +
  45. ["--mount type=bind,src=" + matrix_synapse_ext_path + "/synapse-http-antispam/synapse_http_antispam.py,dst=" + matrix_synapse_in_container_python_packages_path + "/synapse_http_antispam.py,ro"]
  46. }}