Resolve "installation d'un coturn externe"

This commit is contained in:
Antoine Ouvrard
2021-04-27 10:19:53 +00:00
parent 7c4cf16d05
commit 38c5dc95bf
14 changed files with 205 additions and 47 deletions
@@ -0,0 +1,35 @@
---
- name: vérification des variables obligatoire
fail:
msg: |
il faut définir les variables `coturn_hostname` et
`coturn_secret` pour utiliser ce role
when: (coturn_secret is not defined) or
(coturn_hostname is not defined)
# Attention doit etre joué toujours avant la tache d'après
# Car commente le paramètre `turncredentials_secret`
# qui est ensuite renseigné par la tache suivante
- name: indique a jitsi d'utiliser un coturn externe
replace:
path: /etc/prosody/conf.d/{{ inventory_hostname }}.cfg.lua
regexp: '{{ item[0] }}'
replace: '{{ item[1] }}'
loop:
- ['host = "{{ inventory_hostname }}"','host = "{{ coturn_hostname }}"']
- ['-- https_ports = { };','https_ports = { };']
- ['^external_service_secret =', '-- external_service_secret =']
- ['port = 3478','port = 443']
- ['port = 5349','port = 443']
notify: restart prosody
- name: indique a jitsi les règles d'échange des credentials pour le coturn externe
blockinfile:
path: /etc/prosody/conf.d/{{ inventory_hostname }}.cfg.lua
marker: "-- {mark} ANSIBLE MANAGED BLOCK"
insertbefore: 'external_services = {'
block: |
external_service_secret = "{{ coturn_secret }}";
external_service_port = 443;
external_service_ttl = 86400;
notify: restart prosody