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.
 
 
 

42 lines
1.5 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Mautrix Facebook bridge
  4. {% for service in matrix_mautrix_facebook_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_mautrix_facebook_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. PartOf=matrix.target
  13. [Service]
  14. Type=simple
  15. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-mautrix-facebook 2>/dev/null'
  17. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-facebook 2>/dev/null'
  18. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mautrix-facebook \
  19. --log-driver=none \
  20. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  21. --cap-drop=ALL \
  22. --network={{ matrix_docker_network }} \
  23. -v {{ matrix_mautrix_facebook_config_path }}:/config:z \
  24. -v {{ matrix_mautrix_facebook_data_path }}:/data:z \
  25. {% for arg in matrix_mautrix_facebook_container_extra_arguments %}
  26. {{ arg }} \
  27. {% endfor %}
  28. {{ matrix_mautrix_facebook_docker_image }} \
  29. python3 -m mautrix_facebook -c /config/config.yaml --no-update
  30. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-mautrix-facebook 2>/dev/null'
  31. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-facebook 2>/dev/null'
  32. Restart=always
  33. RestartSec=30
  34. SyslogIdentifier=matrix-mautrix-facebook
  35. [Install]
  36. WantedBy=matrix.target