refactor based on Slavi's requests

This commit is contained in:
Horvath Gergely
2020-03-08 00:24:00 +01:00
parent d53d63ab07
commit 310aa685f9
17 changed files with 96 additions and 101 deletions

View File

@ -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: