Matrix Docker Ansible eploy
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 

44 lignes
1.9 KiB

  1. # SPDX-FileCopyrightText: 2024 Slavi Pantaleev
  2. #
  3. # SPDX-License-Identifier: AGPL-3.0-or-later
  4. ---
  5. # This migrates the mailer from the old path (`/matrix/mailer`) to the new path (`/matrix/exim-relay`, controlled by `exim_relay_base_path`),
  6. # and from the old hardcoded systemd service name (`matrix-mailer.service`) to the new one (`matrix-exim-relay.service`, controlled by `exim_relay_identifier`).
  7. #
  8. # Here, we merely disable (and stop) the old systemd service and relocate the base directory path (`/matrix/mailer`).
  9. # The exim-relay role itself (running later) will then ensure this data is up-to-date and will set up the new systemd service.
  10. # It only makes sense to migrate if the identifier or path are different than the default (what we were using before).
  11. - name: Check existence of matrix-mailer.service systemd service
  12. ansible.builtin.stat:
  13. path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mailer.service"
  14. register: matrix_mailer_service_stat
  15. - when: matrix_mailer_service_stat.stat.exists | bool
  16. block:
  17. - name: Ensure matrix-mailer.service systemd service is stopped
  18. ansible.builtin.systemd:
  19. name: matrix-mailer
  20. state: stopped
  21. enabled: false
  22. daemon_reload: true
  23. - name: Ensure matrix-mailer directory relocated
  24. ansible.builtin.command:
  25. cmd: "mv {{ matrix_base_data_path }}/mailer {{ exim_relay_base_path }}"
  26. creates: "{{ exim_relay_base_path }}"
  27. removes: "{{ matrix_base_data_path }}"
  28. # Remove legacy env-mailer file (named `env` in the new role)
  29. - name: Ensure old exim-relay environment variables file is deleted
  30. ansible.builtin.file:
  31. path: "{{ exim_relay_base_path }}/env-mailer"
  32. state: absent
  33. - name: Ensure matrix-mailer.service systemd service doesn't exist
  34. ansible.builtin.file:
  35. path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-mailer.service"
  36. state: absent