Просмотр исходного кода

Add type support to matrix_coturn_container_additional_volumes

.. and try to auto-switch between `bind` and `volume` depending on
whether there's a slash in the `src` path.

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/2482
pull/2489/head
Slavi Pantaleev 3 лет назад
Родитель
Сommit
0b9dc56edf
2 измененных файлов: 3 добавлений и 2 удалений
  1. +2
    -1
      roles/custom/matrix-coturn/defaults/main.yml
  2. +1
    -1
      roles/custom/matrix-coturn/templates/systemd/matrix-coturn.service.j2

+ 2
- 1
roles/custom/matrix-coturn/defaults/main.yml Просмотреть файл

@@ -39,7 +39,8 @@ matrix_coturn_systemd_required_services_list: ['docker.service']
# A list of additional "volumes" to mount in the container. # A list of additional "volumes" to mount in the container.
# This list gets populated dynamically at runtime. You can provide a different default value, # This list gets populated dynamically at runtime. You can provide a different default value,
# if you wish to mount your own files into the container. # if you wish to mount your own files into the container.
# Contains definition objects like this: `{"src": "/outside", "dst": "/inside", "options": "rw|ro|slave|.."}
# Contains definition objects like this: `{"type": "bind", "src": "/outside", "dst": "/inside", "options": "readonly"}.
# See the `--mount` documentation for the `docker run` command.
matrix_coturn_container_additional_volumes: [] matrix_coturn_container_additional_volumes: []


# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container


+ 1
- 1
roles/custom/matrix-coturn/templates/systemd/matrix-coturn.service.j2 Просмотреть файл

@@ -35,7 +35,7 @@ ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name
{% endif %} {% endif %}
--mount type=bind,src={{ matrix_coturn_config_path }},dst=/turnserver.conf,ro \ --mount type=bind,src={{ matrix_coturn_config_path }},dst=/turnserver.conf,ro \
{% for volume in matrix_coturn_container_additional_volumes %} {% for volume in matrix_coturn_container_additional_volumes %}
--mount type=bind,src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \
--mount type={{ volume.type | default('bind' if '/' in volume.src else 'volume') }},src={{ volume.src }},dst={{ volume.dst }}{{ (',' + volume.options) if volume.options else '' }} \
{% endfor %} {% endfor %}
{% for arg in matrix_coturn_container_extra_arguments %} {% for arg in matrix_coturn_container_extra_arguments %}
{{ arg }} \ {{ arg }} \


Загрузка…
Отмена
Сохранить