summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-05-12 15:03:07 +0000
committerAntoine Ouvrard <antoine.ouvrard@nereide.fr>2021-05-12 15:03:07 +0000
commit7442828ccd30c8b405f8f5e18776f82c4e882d64 (patch)
tree6ad6643f55a5c1b2c434a1f05f249c427a767886
parent2bc9af13085f7d591472669a71cf8c8733fc89da (diff)
parentca5a7455575603e6c939f0a2cd75e34a43de8b31 (diff)
Merge branch 'bbb-coturn' into 'master'
bbb: ajout du role pour un coturn externe See merge request 10031/visio!20
-rw-r--r--host_vars/bbb.komuniki.fr.yml4
-rw-r--r--host_vars/visio.imio.be.yml2
-rw-r--r--playbook_prod.yml1
-rw-r--r--roles/bbb-enable-external-coturn/handlers/main.yml3
-rw-r--r--roles/bbb-enable-external-coturn/tasks/main.yml68
-rw-r--r--roles/bbb-enable-metrics/tasks/main.yml4
-rw-r--r--roles/bbb-enable-sip/tasks/main.yml2
7 files changed, 79 insertions, 5 deletions
diff --git a/host_vars/bbb.komuniki.fr.yml b/host_vars/bbb.komuniki.fr.yml
index 3dd9176..55c5c8c 100644
--- a/host_vars/bbb.komuniki.fr.yml
+++ b/host_vars/bbb.komuniki.fr.yml
@@ -2,4 +2,6 @@
bbb_sip_provider: sip5.ovh.fr
bbb_sip_telnum_for_user: 0972551042
bbb_sip_username: 0033972551042
-bbb_sip_password: "{{ vault_bbb_sip_password }}" \ No newline at end of file
+bbb_sip_password: "{{ vault_bbb_sip_password }}"
+coturn_hostname: origan.champs-libres.be
+coturn_secret: "{{ vault_coturn_secret }}"
diff --git a/host_vars/visio.imio.be.yml b/host_vars/visio.imio.be.yml
index ecfe371..6104906 100644
--- a/host_vars/visio.imio.be.yml
+++ b/host_vars/visio.imio.be.yml
@@ -3,4 +3,4 @@ jitsi_logo: visio.imio.be.svg
jitsi_logo_url: https://imio.be
jitsi_multidomain_domain: ['visio-cpas.be']
coturn_hostname: origan.champs-libres.be
-coturn_secret: "{{ vault_coturn_secret }}" \ No newline at end of file
+coturn_secret: "{{ vault_coturn_secret }}"
diff --git a/playbook_prod.yml b/playbook_prod.yml
index 9b31ce2..5404954 100644
--- a/playbook_prod.yml
+++ b/playbook_prod.yml
@@ -37,6 +37,7 @@
- role: bbb-enable-metrics
- role: bbb-disable-test-echo
- role: bbb-enable-sip
+ - role: bbb-enable-external-coturn
tags:
- komki.bbb
diff --git a/roles/bbb-enable-external-coturn/handlers/main.yml b/roles/bbb-enable-external-coturn/handlers/main.yml
new file mode 100644
index 0000000..e794ccc
--- /dev/null
+++ b/roles/bbb-enable-external-coturn/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: restart bigbluebutton
+ command: bbb-conf --restart
diff --git a/roles/bbb-enable-external-coturn/tasks/main.yml b/roles/bbb-enable-external-coturn/tasks/main.yml
new file mode 100644
index 0000000..d182a71
--- /dev/null
+++ b/roles/bbb-enable-external-coturn/tasks/main.yml
@@ -0,0 +1,68 @@
+---
+- 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)
+
+- name: ajout du server turn
+ blockinfile:
+ path: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
+ marker: "<!-- {mark} ANSIBLE MANAGED turn1 -->"
+ # yamllint disable-line rule:line-length
+ insertbefore: ' <bean id="stunTurnService" class="org.bigbluebutton.web.services.turn.StunTurnService">'
+ block: |
+ <bean id="turn1" class="org.bigbluebutton.web.services.turn.TurnServer">
+ <constructor-arg index="0" value="{{ coturn_secret }}"/>
+ <constructor-arg index="1" value="turn:{{ coturn_hostname }}:443?transport=tcp"/>
+ <constructor-arg index="2" value="86400"/>
+ </bean>
+ notify:
+ - restart bigbluebutton
+
+- name: ajout du server turns
+ blockinfile:
+ path: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
+ marker: "<!-- {mark} ANSIBLE MANAGED turn2 -->"
+ # yamllint disable-line rule:line-length
+ insertbefore: ' <bean id="stunTurnService" class="org.bigbluebutton.web.services.turn.StunTurnService">'
+ block: |
+ <bean id="turn2" class="org.bigbluebutton.web.services.turn.TurnServer">
+ <constructor-arg index="0" value="{{ coturn_secret }}"/>
+ <constructor-arg index="1" value="turns:{{ coturn_hostname }}:443?transport=tcp"/>
+ <constructor-arg index="2" value="86400"/>
+ </bean>
+ notify:
+ - restart bigbluebutton
+
+- name: ajout du server stun
+ lineinfile:
+ path: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
+ # yamllint disable-line rule:line-length
+ regexp: ' <constructor-arg index="0" value="stun:stun.freeswitch.org"/>'
+ # yamllint disable-line rule:line-length
+ line: ' <constructor-arg index="0" value="stun:{{ coturn_hostname }}"/>'
+ notify:
+ - restart bigbluebutton
+
+- name: activation du server turn
+ lineinfile:
+ path: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
+ # yamllint disable-line rule:line-length
+ regexp: ' <!--ref bean="turn1" /-->'
+ # yamllint disable-line rule:line-length
+ line: ' <ref bean="turn1" />'
+ notify:
+ - restart bigbluebutton
+
+- name: activation du server turns
+ lineinfile:
+ path: /usr/share/bbb-web/WEB-INF/classes/spring/turn-stun-servers.xml
+ # yamllint disable-line rule:line-length
+ regexp: ' <!--ref bean="turn2" /-->'
+ # yamllint disable-line rule:line-length
+ line: ' <ref bean="turn2" />'
+ notify:
+ - restart bigbluebutton
diff --git a/roles/bbb-enable-metrics/tasks/main.yml b/roles/bbb-enable-metrics/tasks/main.yml
index 5a59ff7..56f4c80 100644
--- a/roles/bbb-enable-metrics/tasks/main.yml
+++ b/roles/bbb-enable-metrics/tasks/main.yml
@@ -24,13 +24,13 @@
## Instalation des metrics BBB
- name: Ajout du script python qui met en forme les metrics BBB
- file:
+ copy:
src: bbb-telegraf.py
dest: /opt/
mode: u=rwx,g=rx,o=rx
- name: Application de la conf BBB pour Telegraf
- file:
+ copy:
src: telegraf-input-bbb.conf
dest: /etc/telegraf/telegraf.d/jitsi.conf
mode: u=rw,g=r,o=r
diff --git a/roles/bbb-enable-sip/tasks/main.yml b/roles/bbb-enable-sip/tasks/main.yml
index a368c2a..39f661d 100644
--- a/roles/bbb-enable-sip/tasks/main.yml
+++ b/roles/bbb-enable-sip/tasks/main.yml
@@ -10,7 +10,7 @@
- restart freeswitch
- name: Application de la conf SIP
- file:
+ copy:
src: bbb_sip_ovh.xml
dest: /opt/freeswitch/conf/dialplan/public/bbb_sip_ovh.xml
mode: u=rw,g=r,o=r