refactor based on Slavi's requests
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
matrix_coturn_enabled: true
|
||||
matrix_coturn_self_build: false
|
||||
|
||||
matrix_coturn_docker_image: "instrumentisto/coturn:4.5.1.1"
|
||||
matrix_coturn_docker_image_force_pull: "{{ matrix_coturn_docker_image.endswith(':latest') }}"
|
||||
@ -13,6 +14,7 @@ matrix_coturn_docker_image_force_pull: "{{ matrix_coturn_docker_image.endswith('
|
||||
matrix_coturn_docker_network: "matrix-coturn"
|
||||
|
||||
matrix_coturn_base_path: "{{ matrix_base_data_path }}/coturn"
|
||||
matrix_docker_coturn_src_files_path: "{{ matrix_coturn_base_path }}/docker-src"
|
||||
matrix_coturn_config_path: "{{ matrix_coturn_base_path }}/turnserver.conf"
|
||||
|
||||
# List of systemd services that matrix-coturn.service depends on
|
||||
|
@ -4,23 +4,34 @@
|
||||
# Tasks related to setting up Coturn
|
||||
#
|
||||
|
||||
- name: Ensure Matrix Coturn path exists
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_username }}"
|
||||
with_items:
|
||||
- { src: "{{ matrix_docker_coturn_src_files_path }}", when: "{{ matrix_coturn_self_build }}"}
|
||||
when: matrix_riot_web_enabled|bool
|
||||
|
||||
- name: Ensure Coturn image is pulled
|
||||
docker_image:
|
||||
name: "{{ matrix_coturn_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_coturn_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_coturn_docker_image_force_pull }}"
|
||||
when: matrix_coturn_enabled|bool and not matrix_raspberry_pi
|
||||
when: matrix_coturn_enabled|bool and not matrix_coturn_self_build
|
||||
|
||||
- name: Ensure Coturn repository is present on Raspberry pi
|
||||
- name: Ensure Coturn repository is present on self-build
|
||||
git:
|
||||
repo: https://github.com/instrumentisto/coturn-docker-image.git
|
||||
dest: "{{ matrix_docker_coturn_src_files_path }}"
|
||||
version: "{{ matrix_coturn_docker_image.split(':')[1] }}"
|
||||
force: "yes"
|
||||
when: "matrix_coturn_enabled|bool and matrix_raspberry_pi"
|
||||
when: "matrix_coturn_enabled|bool and matrix_coturn_self_build"
|
||||
|
||||
- name: Ensure Coturn Docker image is build (Raspberry pi)
|
||||
- name: Ensure Coturn Docker image is build
|
||||
docker_image:
|
||||
name: "{{ matrix_coturn_docker_image }}"
|
||||
source: build
|
||||
@ -28,7 +39,7 @@
|
||||
dockerfile: Dockerfile
|
||||
path: "{{ matrix_docker_coturn_src_files_path }}"
|
||||
pull: yes
|
||||
when: "matrix_coturn_enabled|bool and matrix_raspberry_pi"
|
||||
when: "matrix_coturn_enabled|bool and matrix_coturn_self_build"
|
||||
|
||||
- name: Ensure Coturn configuration path exists
|
||||
file:
|
||||
|
Reference in New Issue
Block a user