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

60 строки
2.4 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix <-> Meshtastic bridge
  4. {% for service in matrix_meshtastic_relay_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_meshtastic_relay_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-meshtastic-relay
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-meshtastic-relay
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-meshtastic-relay \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --tmpfs=/tmp:rw,noexec,nosuid,size=50m \
  25. --tmpfs=/.cache:rw,noexec,nosuid,size=50m \
  26. --mount type=bind,src={{ matrix_meshtastic_relay_config_path }},dst=/config,ro \
  27. --mount type=bind,src={{ matrix_meshtastic_relay_data_path }},dst=/data \
  28. {% if matrix_meshtastic_relay_connection_type == 'ble' %}
  29. --network=host \
  30. --security-opt apparmor=unconfined \
  31. --mount type=bind,src=/var/run/dbus,dst=/var/run/dbus,ro \
  32. {% else %}
  33. --network={{ matrix_meshtastic_relay_container_network }} \
  34. {% endif %}
  35. {% if matrix_meshtastic_relay_connection_type == 'serial' %}
  36. --device={{ matrix_meshtastic_relay_serial_port }} \
  37. {% endif %}
  38. {% for arg in matrix_meshtastic_relay_container_extra_arguments %}
  39. {{ arg }} \
  40. {% endfor %}
  41. {{ matrix_meshtastic_relay_container_image }} \
  42. mmrelay --config /config/config.yaml
  43. {% for network in matrix_meshtastic_relay_container_additional_networks %}
  44. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-meshtastic-relay
  45. {% endfor %}
  46. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-meshtastic-relay
  47. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-meshtastic-relay
  48. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm matrix-meshtastic-relay
  49. Restart=always
  50. RestartSec=30
  51. SyslogIdentifier=matrix-meshtastic-relay
  52. [Install]
  53. WantedBy=multi-user.target