From 1285f4404f58cfcc871f008b9c6ec12f0194df84 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Wed, 10 Feb 2021 22:19:57 +0100 Subject: [PATCH 1/8] move videobridge into seperate role --- {defaults => meet/defaults}/main.yml | 4 +- {handlers => meet/handlers}/main.yml | 0 meet/meta/main.yml | 8 +++ {tasks => meet/tasks}/jitsi-meet.yml | 36 ---------- {tasks => meet/tasks}/main.yml | 7 -- {tasks => meet/tasks}/nginx.yml | 0 {tasks => meet/tasks}/prosody.yml | 0 {tasks => meet/tasks}/ui_customization.yml | 0 .../templates}/interface_config.js.j2 | 0 .../templates}/jicofo/config.j2 | 0 .../jicofo/sip-communicator.properties.j2 | 3 + .../templates}/logrotate.d/jicofo.j2 | 0 .../templates}/logrotate.d/nginx.j2 | 0 .../templates}/logrotate.d/prosody.j2 | 0 .../templates}/meet-config.js.j2 | 0 .../templates}/nginx/nginx.conf.j2 | 0 .../nginx/sites-available/vhost.conf.j2 | 18 ++--- .../prosody/conf.avail/virtualhost.cfg.lua.j2 | 0 .../templates}/prosody/prosody.cfg.lua.j2 | 0 {templates => meet/templates}/title.html.j2 | 0 meta/main.yml | 7 -- videobridge/defaults/main.yml | 11 +++ videobridge/handlers/main.yml | 5 ++ videobridge/meta/main.yml | 9 +++ videobridge/tasks/main.yml | 69 +++++++++++++++++++ .../templates}/videobridge/config.j2 | 0 videobridge/templates/videobridge/jvb.conf.j2 | 13 ++++ .../videobridge/logging.properties.j2 | 0 .../sip-communicator.properties.j2 | 0 29 files changed, 129 insertions(+), 61 deletions(-) rename {defaults => meet/defaults}/main.yml (98%) rename {handlers => meet/handlers}/main.yml (100%) create mode 100644 meet/meta/main.yml rename {tasks => meet/tasks}/jitsi-meet.yml (61%) rename {tasks => meet/tasks}/main.yml (72%) rename {tasks => meet/tasks}/nginx.yml (100%) rename {tasks => meet/tasks}/prosody.yml (100%) rename {tasks => meet/tasks}/ui_customization.yml (100%) rename {templates => meet/templates}/interface_config.js.j2 (100%) rename {templates => meet/templates}/jicofo/config.j2 (100%) create mode 100644 meet/templates/jicofo/sip-communicator.properties.j2 rename {templates => meet/templates}/logrotate.d/jicofo.j2 (100%) rename {templates => meet/templates}/logrotate.d/nginx.j2 (100%) rename {templates => meet/templates}/logrotate.d/prosody.j2 (100%) rename {templates => meet/templates}/meet-config.js.j2 (100%) rename {templates => meet/templates}/nginx/nginx.conf.j2 (100%) rename {templates => meet/templates}/nginx/sites-available/vhost.conf.j2 (89%) rename {templates => meet/templates}/prosody/conf.avail/virtualhost.cfg.lua.j2 (100%) rename {templates => meet/templates}/prosody/prosody.cfg.lua.j2 (100%) rename {templates => meet/templates}/title.html.j2 (100%) create mode 100644 videobridge/defaults/main.yml create mode 100644 videobridge/handlers/main.yml create mode 100644 videobridge/meta/main.yml create mode 100644 videobridge/tasks/main.yml rename {templates => videobridge/templates}/videobridge/config.j2 (100%) create mode 100644 videobridge/templates/videobridge/jvb.conf.j2 rename {templates => videobridge/templates}/videobridge/logging.properties.j2 (100%) rename {templates => videobridge/templates}/videobridge/sip-communicator.properties.j2 (100%) diff --git a/defaults/main.yml b/meet/defaults/main.yml similarity index 98% rename from defaults/main.yml rename to meet/defaults/main.yml index 4afedde..2d7d464 100644 --- a/defaults/main.yml +++ b/meet/defaults/main.yml @@ -5,10 +5,9 @@ jitsi_meet_packages: - jitsi-meet-prosody - jitsi-meet-web - jitsi-meet-web-config - - jitsi-videobridge2 jitsi_meet_server_name: "meet.example.com" -jitsi_meet_videobridge_port: 5347 + jitsi_meet_jicofo_user: focus jitsi_meet_jicofo_port: 5347 @@ -71,7 +70,6 @@ jitsi_meet_debsums_ignore_custom_assets: false ## Logging jitsi_meet_logrotate_retained_days: 7 jitsi_meet_loglevel: "WARNING" -jitsi_meet_videobridge_loglevel: "{{ jitsi_meet_loglevel }}" jitsi_meet_jicofo_loglevel: "{{ jitsi_meet_loglevel }}" jitsi_meet_jicofo_logging_properties: | handlers= java.util.logging.ConsoleHandler diff --git a/handlers/main.yml b/meet/handlers/main.yml similarity index 100% rename from handlers/main.yml rename to meet/handlers/main.yml diff --git a/meet/meta/main.yml b/meet/meta/main.yml new file mode 100644 index 0000000..76c9fce --- /dev/null +++ b/meet/meta/main.yml @@ -0,0 +1,8 @@ +--- +dependencies: + - role: systemli.apt_repositories + vars: + apt_repositories: + - preset: jitsi + name: download_jitsi_org + packages: "{{ jitsi_meet_packages }}" diff --git a/tasks/jitsi-meet.yml b/meet/tasks/jitsi-meet.yml similarity index 61% rename from tasks/jitsi-meet.yml rename to meet/tasks/jitsi-meet.yml index 4615efb..7287c2a 100644 --- a/tasks/jitsi-meet.yml +++ b/meet/tasks/jitsi-meet.yml @@ -7,10 +7,6 @@ value: "{{ item.value }}" vtype: "{{ item.vtype }}" loop: - - name: jitsi-videobridge2 - question: jitsi-videobridge/jvb-hostname - value: "{{ jitsi_meet_server_name }}" - vtype: string - name: jitsi-meet-web-config question: jitsi-meet/cert-choice value: "{{ jitsi_meet_cert_choice }}" @@ -34,15 +30,6 @@ install_recommends: no state: present -- name: Copy sip-communicator.properties - template: - src: videobridge/sip-communicator.properties.j2 - dest: /etc/jitsi/videobridge/sip-communicator.properties - owner: jvb - group: jitsi - mode: 0640 - notify: restart jitsi-videobridge2 - - name: Copy jicofo config template: src: jicofo/config.j2 @@ -61,35 +48,12 @@ mode: 0640 notify: restart jicofo -- name: Copy jitsi-videobridge2 config - template: - src: videobridge/config.j2 - dest: /etc/jitsi/videobridge/config - owner: jvb - group: jitsi - mode: 0640 - notify: restart jitsi-videobridge2 - -- name: Copy jitsi-videobridge2 log.properties - template: - src: videobridge/logging.properties.j2 - dest: /etc/jitsi/videobridge/logging.properties - owner: jvb - group: jitsi - mode: 0640 - notify: restart jitsi-videobridge2 - - name: Copy jitsi meet config template: mode: 0644 src: meet-config.js.j2 dest: "/etc/jitsi/meet/{{ jitsi_meet_server_name }}-config.js" -- name: Enable jitsi-videobridge2 - service: - name: jitsi-videobridge2 - enabled: yes - - name: Enable jicofo service: name: jicofo diff --git a/tasks/main.yml b/meet/tasks/main.yml similarity index 72% rename from tasks/main.yml rename to meet/tasks/main.yml index 5fbbef8..e578eec 100644 --- a/tasks/main.yml +++ b/meet/tasks/main.yml @@ -4,18 +4,11 @@ set_fact: "{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}" loop: - - jitsi_meet_videobridge_secret - - jitsi_meet_videobridge_password - jitsi_meet_jicofo_secret - jitsi_meet_jicofo_password - jitsi_meet_turn_secret when: jitsi_meet_base_secret is defined -- name: Derive videobridge nickname - set_fact: - jitsi_meet_videobridge_muc_nickname: "{{ (jitsi_meet_base_secret | string + 'jvb_muc_nick') | to_uuid }}" - when: jitsi_meet_base_secret is defined - - import_tasks: jitsi-meet.yml - import_tasks: prosody.yml - import_tasks: ui_customization.yml diff --git a/tasks/nginx.yml b/meet/tasks/nginx.yml similarity index 100% rename from tasks/nginx.yml rename to meet/tasks/nginx.yml diff --git a/tasks/prosody.yml b/meet/tasks/prosody.yml similarity index 100% rename from tasks/prosody.yml rename to meet/tasks/prosody.yml diff --git a/tasks/ui_customization.yml b/meet/tasks/ui_customization.yml similarity index 100% rename from tasks/ui_customization.yml rename to meet/tasks/ui_customization.yml diff --git a/templates/interface_config.js.j2 b/meet/templates/interface_config.js.j2 similarity index 100% rename from templates/interface_config.js.j2 rename to meet/templates/interface_config.js.j2 diff --git a/templates/jicofo/config.j2 b/meet/templates/jicofo/config.j2 similarity index 100% rename from templates/jicofo/config.j2 rename to meet/templates/jicofo/config.j2 diff --git a/meet/templates/jicofo/sip-communicator.properties.j2 b/meet/templates/jicofo/sip-communicator.properties.j2 new file mode 100644 index 0000000..d716b1a --- /dev/null +++ b/meet/templates/jicofo/sip-communicator.properties.j2 @@ -0,0 +1,3 @@ +org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.{{ jitsi_meet_server_name }} +org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.{{ jitsi_meet_server_name }} +org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90 \ No newline at end of file diff --git a/templates/logrotate.d/jicofo.j2 b/meet/templates/logrotate.d/jicofo.j2 similarity index 100% rename from templates/logrotate.d/jicofo.j2 rename to meet/templates/logrotate.d/jicofo.j2 diff --git a/templates/logrotate.d/nginx.j2 b/meet/templates/logrotate.d/nginx.j2 similarity index 100% rename from templates/logrotate.d/nginx.j2 rename to meet/templates/logrotate.d/nginx.j2 diff --git a/templates/logrotate.d/prosody.j2 b/meet/templates/logrotate.d/prosody.j2 similarity index 100% rename from templates/logrotate.d/prosody.j2 rename to meet/templates/logrotate.d/prosody.j2 diff --git a/templates/meet-config.js.j2 b/meet/templates/meet-config.js.j2 similarity index 100% rename from templates/meet-config.js.j2 rename to meet/templates/meet-config.js.j2 diff --git a/templates/nginx/nginx.conf.j2 b/meet/templates/nginx/nginx.conf.j2 similarity index 100% rename from templates/nginx/nginx.conf.j2 rename to meet/templates/nginx/nginx.conf.j2 diff --git a/templates/nginx/sites-available/vhost.conf.j2 b/meet/templates/nginx/sites-available/vhost.conf.j2 similarity index 89% rename from templates/nginx/sites-available/vhost.conf.j2 rename to meet/templates/nginx/sites-available/vhost.conf.j2 index f9717c9..7e89c66 100644 --- a/templates/nginx/sites-available/vhost.conf.j2 +++ b/meet/templates/nginx/sites-available/vhost.conf.j2 @@ -93,14 +93,16 @@ server { tcp_nodelay on; } - # colibri (JVB) websockets for jvb1 - location ~ ^/colibri-ws/default-id/(.*) { - proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - tcp_nodelay on; - } + # colibri (JVB) websockets +{% for videobridge in groups['videobridges'] %} + location ~ ^/colibri-ws/{{ videobridge }}/(.*) { + proxy_pass http://{{ hostvars[videobridge]['ansible_default_ipv4']['address'] }}:9090/colibri-ws/{{ videobridge }}/$1$is_args$args; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + tcp_nodelay on; + } +{% endfor %} location ~ ^/([^/?&:'"]+)$ { try_files $uri @root_path; diff --git a/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 b/meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 similarity index 100% rename from templates/prosody/conf.avail/virtualhost.cfg.lua.j2 rename to meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 diff --git a/templates/prosody/prosody.cfg.lua.j2 b/meet/templates/prosody/prosody.cfg.lua.j2 similarity index 100% rename from templates/prosody/prosody.cfg.lua.j2 rename to meet/templates/prosody/prosody.cfg.lua.j2 diff --git a/templates/title.html.j2 b/meet/templates/title.html.j2 similarity index 100% rename from templates/title.html.j2 rename to meet/templates/title.html.j2 diff --git a/meta/main.yml b/meta/main.yml index 55c3161..6eec090 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -16,10 +16,3 @@ galaxy_info: - buster notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ -dependencies: - - role: systemli.apt_repositories - vars: - apt_repositories: - - preset: jitsi - name: download_jitsi_org - packages: "{{ jitsi_meet_packages }}" diff --git a/videobridge/defaults/main.yml b/videobridge/defaults/main.yml new file mode 100644 index 0000000..3830238 --- /dev/null +++ b/videobridge/defaults/main.yml @@ -0,0 +1,11 @@ +--- +# Global +jitsi_meet_server_name: "meet.example.com" +jitsi_meet_config_stun_servers: + - meet-jit-si-turnrelay.jitsi.net:443 + +# Videobridge +jitsi_meet_videobridge_port: 5347 + +## Logging +jitsi_meet_videobridge_loglevel: "{{ jitsi_meet_loglevel }}" diff --git a/videobridge/handlers/main.yml b/videobridge/handlers/main.yml new file mode 100644 index 0000000..9964ec6 --- /dev/null +++ b/videobridge/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: restart jitsi-videobridge2 + service: + name: jitsi-videobridge2 + state: restarted diff --git a/videobridge/meta/main.yml b/videobridge/meta/main.yml new file mode 100644 index 0000000..7bdfb31 --- /dev/null +++ b/videobridge/meta/main.yml @@ -0,0 +1,9 @@ +--- +dependencies: + - role: systemli.apt_repositories + vars: + apt_repositories: + - preset: jitsi + name: download_jitsi_org + packages: + - jitsi-videobridge2 diff --git a/videobridge/tasks/main.yml b/videobridge/tasks/main.yml new file mode 100644 index 0000000..7a73c5d --- /dev/null +++ b/videobridge/tasks/main.yml @@ -0,0 +1,69 @@ +--- +- name: Derive individual secrets from base secret + set_fact: + "{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}" + loop: + - jitsi_meet_videobridge_secret + - jitsi_meet_videobridge_password + when: jitsi_meet_base_secret is defined + +- name: Derive videobridge nickname + set_fact: + jitsi_meet_videobridge_muc_nickname: "{{ (jitsi_meet_base_secret | string + 'jvb_muc_nick') | to_uuid }}" + when: jitsi_meet_base_secret is defined + +- name: Set debconf options for jitsi-videobridge + debconf: + name: "{{ item.name }}" + question: "{{ item.question }}" + value: "{{ item.value }}" + vtype: "{{ item.vtype }}" + loop: + - name: jitsi-videobridge2 + question: jitsi-videobridge/jvb-hostname + value: "{{ jitsi_meet_server_name }}" + vtype: string + +- name: Install jitsi-videobridge + apt: + pkg: jitsi-videobridge2 + install_recommends: no + state: present + update_cache: yes + +- name: Copy videobridge sip-communicator.properties + template: + src: videobridge/sip-communicator.properties.j2 + dest: /etc/jitsi/videobridge/sip-communicator.properties + owner: jvb + group: jitsi + mode: 0640 + notify: restart jitsi-videobridge2 + +- name: Copy jitsi-videobridge2 config + template: + src: videobridge/{{ item }}.j2 + dest: /etc/jitsi/videobridge/{{ item }} + owner: jvb + group: jitsi + mode: 0640 + with_items: + - config + - jvb.conf + notify: restart jitsi-videobridge2 + +- name: Copy jitsi-videobridge2 log.properties + template: + src: videobridge/logging.properties.j2 + dest: /etc/jitsi/videobridge/logging.properties + owner: jvb + group: jitsi + mode: 0640 + notify: restart jitsi-videobridge2 + +- name: Enable jitsi-videobridge2 + service: + name: jitsi-videobridge2 + enabled: yes + +- meta: flush_handlers diff --git a/templates/videobridge/config.j2 b/videobridge/templates/videobridge/config.j2 similarity index 100% rename from templates/videobridge/config.j2 rename to videobridge/templates/videobridge/config.j2 diff --git a/videobridge/templates/videobridge/jvb.conf.j2 b/videobridge/templates/videobridge/jvb.conf.j2 new file mode 100644 index 0000000..c36e349 --- /dev/null +++ b/videobridge/templates/videobridge/jvb.conf.j2 @@ -0,0 +1,13 @@ +videobridge { + http-servers { + public { + port = 9090 + } + } + websockets { + enabled = true + domain = "{{ jitsi_meet_server_name }}:443" + tls = true + server-id = {{ ansible_hostname }} + } +} diff --git a/templates/videobridge/logging.properties.j2 b/videobridge/templates/videobridge/logging.properties.j2 similarity index 100% rename from templates/videobridge/logging.properties.j2 rename to videobridge/templates/videobridge/logging.properties.j2 diff --git a/templates/videobridge/sip-communicator.properties.j2 b/videobridge/templates/videobridge/sip-communicator.properties.j2 similarity index 100% rename from templates/videobridge/sip-communicator.properties.j2 rename to videobridge/templates/videobridge/sip-communicator.properties.j2 From 0d8dfba4d1532890adf25c08efa94e1c7999c8e0 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Fri, 12 Feb 2021 19:21:56 +0100 Subject: [PATCH 2/8] configure for multiple videobridge setup --- meet/defaults/main.yml | 4 +++- meet/tasks/jitsi-meet.yml | 20 +++++++++++++++++++ meet/tasks/main.yml | 2 ++ meet/templates/jicofo/config.j2 | 7 ++++++- .../jicofo/sip-communicator.properties.j2 | 2 -- .../nginx/sites-available/vhost.conf.j2 | 4 ++-- meet/templates/prosody/prosody.cfg.lua.j2 | 2 ++ videobridge/defaults/main.yml | 8 +++++++- videobridge/tasks/main.yml | 5 ----- videobridge/templates/videobridge/config.j2 | 7 ++++++- .../sip-communicator.properties.j2 | 6 ++++-- 11 files changed, 52 insertions(+), 15 deletions(-) diff --git a/meet/defaults/main.yml b/meet/defaults/main.yml index 2d7d464..f28805c 100644 --- a/meet/defaults/main.yml +++ b/meet/defaults/main.yml @@ -1,13 +1,15 @@ --- jitsi_meet_packages: - - jitsi-meet + - jicofo - jitsi-meet-prosody - jitsi-meet-web - jitsi-meet-web-config jitsi_meet_server_name: "meet.example.com" +jitsi_meet_videobridge_instances: "{{ groups['videobridges'] }}" + jitsi_meet_jicofo_user: focus jitsi_meet_jicofo_port: 5347 diff --git a/meet/tasks/jitsi-meet.yml b/meet/tasks/jitsi-meet.yml index 7287c2a..e2df5f0 100644 --- a/meet/tasks/jitsi-meet.yml +++ b/meet/tasks/jitsi-meet.yml @@ -23,6 +23,18 @@ question: jitsi-meet-prosody/turn-secret value: "{{ jitsi_meet_turn_secret }}" vtype: string + - name: jitsi-meet-prosody + question: jitsi-videobridge/jvb-hostname + value: "{{ jitsi_meet_server_name }}" + vtype: string + - name: jitsi-videobridge2 + question: jitsi-videobridge/jvb-hostname + value: "{{ jitsi_meet_server_name }}" + vtype: string + - name: jitsi-meet + question: jitsi-meet/jvb-serve + value: "false" + vtype: boolean - name: Install jitsi-meet apt: @@ -39,6 +51,14 @@ mode: 0640 notify: restart jicofo +- name: Copy jicofo sip-communicator.properties + template: + src: jicofo/sip-communicator.properties.j2 + dest: /etc/jitsi/jicofo/sip-communicator.properties + owner: jicofo + group: jitsi + notify: restart jicofo + - name: Copy Jicofo log.properties copy: content: "{{ jitsi_meet_jicofo_logging_properties }}" diff --git a/meet/tasks/main.yml b/meet/tasks/main.yml index e578eec..f45d88f 100644 --- a/meet/tasks/main.yml +++ b/meet/tasks/main.yml @@ -4,6 +4,8 @@ set_fact: "{{ item }}": "{{ (item + jitsi_meet_base_secret | string) | hash('sha1') }}" loop: + - jitsi_meet_videobridge_secret + - jitsi_meet_videobridge_password - jitsi_meet_jicofo_secret - jitsi_meet_jicofo_password - jitsi_meet_turn_secret diff --git a/meet/templates/jicofo/config.j2 b/meet/templates/jicofo/config.j2 index ab5a5c2..59e65e7 100644 --- a/meet/templates/jicofo/config.j2 +++ b/meet/templates/jicofo/config.j2 @@ -24,4 +24,9 @@ JICOFO_AUTH_PASSWORD={{ jitsi_meet_jicofo_password }} JICOFO_OPTS="" # adds java system props that are passed to jicofo (default are for home and logging config file) -JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/jicofo/logging.properties" +JAVA_SYS_PROPS=" \ + -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi \ + -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=jicofo \ + -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi \ + -Djava.util.logging.config.file=/etc/jitsi/jicofo/logging.properties \ +" diff --git a/meet/templates/jicofo/sip-communicator.properties.j2 b/meet/templates/jicofo/sip-communicator.properties.j2 index d716b1a..03b0049 100644 --- a/meet/templates/jicofo/sip-communicator.properties.j2 +++ b/meet/templates/jicofo/sip-communicator.properties.j2 @@ -1,3 +1 @@ org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.{{ jitsi_meet_server_name }} -org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.{{ jitsi_meet_server_name }} -org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90 \ No newline at end of file diff --git a/meet/templates/nginx/sites-available/vhost.conf.j2 b/meet/templates/nginx/sites-available/vhost.conf.j2 index 7e89c66..e851bac 100644 --- a/meet/templates/nginx/sites-available/vhost.conf.j2 +++ b/meet/templates/nginx/sites-available/vhost.conf.j2 @@ -94,9 +94,9 @@ server { } # colibri (JVB) websockets -{% for videobridge in groups['videobridges'] %} +{% for videobridge in jitsi_meet_videobridge_instances %} location ~ ^/colibri-ws/{{ videobridge }}/(.*) { - proxy_pass http://{{ hostvars[videobridge]['ansible_default_ipv4']['address'] }}:9090/colibri-ws/{{ videobridge }}/$1$is_args$args; + proxy_pass http://{{ hostvars[videobridge]['private_ipv4'] | default(hostvars[videobridge]['ansible_default_ipv4']['address']) }}:9090/colibri-ws/{{ videobridge }}/$1$is_args$args; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; diff --git a/meet/templates/prosody/prosody.cfg.lua.j2 b/meet/templates/prosody/prosody.cfg.lua.j2 index 00f6832..54a1c00 100644 --- a/meet/templates/prosody/prosody.cfg.lua.j2 +++ b/meet/templates/prosody/prosody.cfg.lua.j2 @@ -23,6 +23,8 @@ -- Example: admins = { "user1@example.com", "user2@example.net" } admins = { } +network_backend = "epoll" + -- Enable use of libevent for better performance under high load -- For more information see: https://prosody.im/doc/libevent --use_libevent = true diff --git a/videobridge/defaults/main.yml b/videobridge/defaults/main.yml index 3830238..dcafb71 100644 --- a/videobridge/defaults/main.yml +++ b/videobridge/defaults/main.yml @@ -3,9 +3,15 @@ jitsi_meet_server_name: "meet.example.com" jitsi_meet_config_stun_servers: - meet-jit-si-turnrelay.jitsi.net:443 +jitsi_meet_jicofo_user: focus # Videobridge jitsi_meet_videobridge_port: 5347 +## single server vs scalable setup +jitsi_meet_single_instance: "{{ inventory_hostname == groups['meet'][0] }}" +jitsi_meet_videobridge_prosody_server_ip: "{{ jitsi_meet_single_instance | ternary('localhost', (hostvars[groups['meet'][0]]['private_ipv4'] | default(hostvars[groups['meet'][0]]['ansible_default_ipv4']['address']))) }}" +jitsi_meet_videobridge_muc_nickname: "{{ jitsi_meet_single_instance | ternary('jvb1', ansible_hostname) }}" + ## Logging -jitsi_meet_videobridge_loglevel: "{{ jitsi_meet_loglevel }}" +jitsi_meet_videobridge_loglevel: "WARNING" diff --git a/videobridge/tasks/main.yml b/videobridge/tasks/main.yml index 7a73c5d..ae1ebc1 100644 --- a/videobridge/tasks/main.yml +++ b/videobridge/tasks/main.yml @@ -7,11 +7,6 @@ - jitsi_meet_videobridge_password when: jitsi_meet_base_secret is defined -- name: Derive videobridge nickname - set_fact: - jitsi_meet_videobridge_muc_nickname: "{{ (jitsi_meet_base_secret | string + 'jvb_muc_nick') | to_uuid }}" - when: jitsi_meet_base_secret is defined - - name: Set debconf options for jitsi-videobridge debconf: name: "{{ item.name }}" diff --git a/videobridge/templates/videobridge/config.j2 b/videobridge/templates/videobridge/config.j2 index 39739b0..706583a 100644 --- a/videobridge/templates/videobridge/config.j2 +++ b/videobridge/templates/videobridge/config.j2 @@ -16,4 +16,9 @@ JVB_SECRET={{ jitsi_meet_videobridge_secret }} JVB_OPTS="--apis=rest,xmpp" # adds java system props that are passed to jvb (default are for home and logging config file) -JAVA_SYS_PROPS="-Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties" +JAVA_SYS_PROPS=" \ + -Dnet.java.sip.communicator.SC_HOME_DIR_LOCATION=/etc/jitsi \ + -Dnet.java.sip.communicator.SC_HOME_DIR_NAME=videobridge \ + -Dnet.java.sip.communicator.SC_LOG_DIR_LOCATION=/var/log/jitsi \ + -Djava.util.logging.config.file=/etc/jitsi/videobridge/logging.properties \ +" diff --git a/videobridge/templates/videobridge/sip-communicator.properties.j2 b/videobridge/templates/videobridge/sip-communicator.properties.j2 index 63b50ae..7502f07 100644 --- a/videobridge/templates/videobridge/sip-communicator.properties.j2 +++ b/videobridge/templates/videobridge/sip-communicator.properties.j2 @@ -4,11 +4,13 @@ org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES={{ jitsi_meet_config_stun org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS="{{ jitsi_meet_nat_local_ip }}" org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS="{{ jitsi_meet_nat_public_ip }}" {% endif %} +org.jitsi.videobridge.AUTHORIZED_SOURCE_REGEXP=jvbbrewery@internal.auth.{{ jitsi_meet_server_name }}/{{ jitsi_meet_jicofo_user }}.*$ org.jitsi.videobridge.ENABLE_STATISTICS=true -org.jitsi.videobridge.STATISTICS_TRANSPORT=muc -org.jitsi.videobridge.xmpp.user.shard.HOSTNAME=localhost +org.jitsi.videobridge.STATISTICS_TRANSPORT=muc,colibri +org.jitsi.videobridge.xmpp.user.shard.HOSTNAME={{ jitsi_meet_videobridge_prosody_server_ip }} org.jitsi.videobridge.xmpp.user.shard.DOMAIN=auth.{{ jitsi_meet_server_name }} org.jitsi.videobridge.xmpp.user.shard.USERNAME=jvb org.jitsi.videobridge.xmpp.user.shard.PASSWORD={{ jitsi_meet_videobridge_password }} org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.{{ jitsi_meet_server_name }} org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME={{ jitsi_meet_videobridge_muc_nickname }} +org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true From 93ab0a72cd55c83e666fc8799f1c6a3e79fa100c Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Sun, 14 Feb 2021 19:53:19 +0100 Subject: [PATCH 3/8] fix prosody warnings --- meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 b/meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 index 918ac82..6ddb2c7 100644 --- a/meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 +++ b/meet/templates/prosody/conf.avail/virtualhost.cfg.lua.j2 @@ -15,6 +15,7 @@ turncredentials = { cross_domain_bosh = false; consider_bosh_secure = true; +https_ports = { } -- https is proxied through nginx VirtualHost "{{ jitsi_meet_server_name }}" -- enabled = false -- Remove this line to enable this host From b011934aca8ada3434c8cf469f6927bb0239bb64 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Sun, 14 Feb 2021 21:07:03 +0100 Subject: [PATCH 4/8] fix jicofo logging --- meet/defaults/main.yml | 40 ----------------- meet/tasks/jitsi-meet.yml | 6 +-- meet/templates/jicofo/logging.properties.j2 | 50 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 meet/templates/jicofo/logging.properties.j2 diff --git a/meet/defaults/main.yml b/meet/defaults/main.yml index f28805c..1f90e01 100644 --- a/meet/defaults/main.yml +++ b/meet/defaults/main.yml @@ -73,46 +73,6 @@ jitsi_meet_debsums_ignore_custom_assets: false jitsi_meet_logrotate_retained_days: 7 jitsi_meet_loglevel: "WARNING" jitsi_meet_jicofo_loglevel: "{{ jitsi_meet_loglevel }}" -jitsi_meet_jicofo_logging_properties: | - handlers= java.util.logging.ConsoleHandler - #handlers= java.util.logging.ConsoleHandler, com.agafua.syslog.SyslogHandler - - java.util.logging.ConsoleHandler.level = {{ jitsi_meet_jicofo_loglevel }} - java.util.logging.ConsoleHandler.formatter = org.jitsi.utils.logging2.JitsiLogFormatter - - net.java.sip.communicator.util.ScLogFormatter.programname=JVB - - .level= {{ jitsi_meet_jicofo_loglevel }} - - org.jitsi.videobridge.xmpp.ComponentImpl.level=FINE - - # All of the INFO level logs from MediaStreamImpl are unnecessary in the context of jitsi-videobridge. - org.jitsi.impl.neomedia.MediaStreamImpl.level=WARNING - - # Syslog(uncomment handler to use) - com.agafua.syslog.SyslogHandler.transport = udp - com.agafua.syslog.SyslogHandler.facility = local0 - com.agafua.syslog.SyslogHandler.port = 514 - com.agafua.syslog.SyslogHandler.hostname = localhost - com.agafua.syslog.SyslogHandler.formatter = org.jitsi.utils.logging2.JitsiLogFormatter - com.agafua.syslog.SyslogHandler.escapeNewlines = false - - # to disable double timestamps in syslog uncomment next line - #net.java.sip.communicator.util.ScLogFormatter.disableTimestamp=true - - # time series logging - java.util.logging.SimpleFormatter.format= %5$s%n - java.util.logging.FileHandler.level = ALL - java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter - java.util.logging.FileHandler.pattern = /tmp/jvb-series.log - java.util.logging.FileHandler.limit = 200000000 - java.util.logging.FileHandler.count = 1 - java.util.logging.FileHandler.append = false - - timeseries.level=OFF - timeseries.org.jitsi.videobridge.cc.vp8.level=ALL - timeseries.useParentHandlers = false - timeseries.handlers = java.util.logging.FileHandler # Disable nginx access log per default jitsi_meet_nginx_access_log: "off" diff --git a/meet/tasks/jitsi-meet.yml b/meet/tasks/jitsi-meet.yml index e2df5f0..2e26863 100644 --- a/meet/tasks/jitsi-meet.yml +++ b/meet/tasks/jitsi-meet.yml @@ -59,9 +59,9 @@ group: jitsi notify: restart jicofo -- name: Copy Jicofo log.properties - copy: - content: "{{ jitsi_meet_jicofo_logging_properties }}" +- name: Copy Jicofo logging.properties + template: + src: jicofo/logging.properties.j2 dest: /etc/jitsi/jicofo/logging.properties owner: jicofo group: jitsi diff --git a/meet/templates/jicofo/logging.properties.j2 b/meet/templates/jicofo/logging.properties.j2 new file mode 100644 index 0000000..f149386 --- /dev/null +++ b/meet/templates/jicofo/logging.properties.j2 @@ -0,0 +1,50 @@ +handlers= java.util.logging.ConsoleHandler + +# Handlers with XMPP debug enabled: +#handlers= java.util.logging.ConsoleHandler, org.jitsi.impl.protocol.xmpp.log.XmppPacketsFileHandler + +# Handlers with syslog enabled: +#handlers= java.util.logging.ConsoleHandler, com.agafua.syslog.SyslogHandler + +java.util.logging.ConsoleHandler.level = {{ jitsi_meet_jicofo_loglevel }} +java.util.logging.ConsoleHandler.formatter = org.jitsi.utils.logging2.JitsiLogFormatter +java.util.logging.ConsoleHandler.filter = org.jitsi.impl.protocol.xmpp.log.ExcludeXmppPackets + +net.java.sip.communicator.util.ScLogFormatter.programname=Jicofo +.level= {{ jitsi_meet_jicofo_loglevel }} + +# To enable XMPP packets logging add XmppPacketsFileHandler to the handlers property +org.jitsi.impl.protocol.xmpp.log.PacketDebugger.level=ALL +org.jitsi.impl.protocol.xmpp.log.XmppPacketsFileHandler.pattern=/var/log/jitsi/jicofo-xmpp.log +org.jitsi.impl.protocol.xmpp.log.XmppPacketsFileHandler.append=true +org.jitsi.impl.protocol.xmpp.log.XmppPacketsFileHandler.limit=200000000 +org.jitsi.impl.protocol.xmpp.log.XmppPacketsFileHandler.count=3 + +# Syslog (uncomment handler to use) +com.agafua.syslog.SyslogHandler.transport = udp +com.agafua.syslog.SyslogHandler.facility = local0 +com.agafua.syslog.SyslogHandler.port = 514 +com.agafua.syslog.SyslogHandler.hostname = localhost +com.agafua.syslog.SyslogHandler.formatter = org.jitsi.utils.logging2.JitsiLogFormatter +com.agafua.syslog.SyslogHandler.escapeNewlines = false +com.agafua.syslog.SyslogHandler.filter = org.jitsi.impl.protocol.xmpp.log.ExcludeXmppPackets + +# to disable double timestamps in syslog uncomment next line +#net.java.sip.communicator.util.ScLogFormatter.disableTimestamp=true + +# time series logging +java.util.logging.SimpleFormatter.format= %5$s%n +java.util.logging.FileHandler.level = ALL +java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter +java.util.logging.FileHandler.pattern = /tmp/jvb-series.log +java.util.logging.FileHandler.limit = 200000000 +java.util.logging.FileHandler.count = 1 +java.util.logging.FileHandler.append = false + +timeseries.level=OFF +timeseries.org.jitsi.videobridge.cc.vp8.level=ALL +timeseries.useParentHandlers = false +timeseries.handlers = java.util.logging.FileHandler + +# uncomment to see how Jicofo talks to the JVB +#org.jitsi.impl.protocol.xmpp.colibri.level=ALL From 5f463e0a300c944ca933cc5e9ac4a3f782232512 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Sun, 14 Feb 2021 22:32:49 +0100 Subject: [PATCH 5/8] configure octo --- meet/defaults/main.yml | 4 ++++ meet/templates/jicofo/sip-communicator.properties.j2 | 4 ++++ meet/templates/meet-config.js.j2 | 9 +++++++-- videobridge/defaults/main.yml | 6 ++++++ .../videobridge/sip-communicator.properties.j2 | 10 ++++++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/meet/defaults/main.yml b/meet/defaults/main.yml index 1f90e01..68f7832 100644 --- a/meet/defaults/main.yml +++ b/meet/defaults/main.yml @@ -68,6 +68,9 @@ jitsi_meet_title_favicon: images/favicon.ico?v=1 jitsi_meet_debsums_ignore_custom_assets: false +# Octo +jitsi_meet_octo_enabled: False +jitsi_meet_octo_selection_strategy: "RegionBasedBridgeSelectionStrategy" ## Logging jitsi_meet_logrotate_retained_days: 7 @@ -77,6 +80,7 @@ jitsi_meet_jicofo_loglevel: "{{ jitsi_meet_loglevel }}" # Disable nginx access log per default jitsi_meet_nginx_access_log: "off" jitsi_meet_nginx_error_log: /var/log/nginx/error.log + jitsi_meet_nginx_ssl_preset: "intermediate" jitsi_meet_nginx_ssl_presets: modern: diff --git a/meet/templates/jicofo/sip-communicator.properties.j2 b/meet/templates/jicofo/sip-communicator.properties.j2 index 03b0049..11dc34e 100644 --- a/meet/templates/jicofo/sip-communicator.properties.j2 +++ b/meet/templates/jicofo/sip-communicator.properties.j2 @@ -1 +1,5 @@ org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.{{ jitsi_meet_server_name }} + +{% if jitsi_meet_octo_enabled -%} +org.jitsi.jicofo.BridgeSelector.BRIDGE_SELECTION_STRATEGY={{ jitsi_meet_octo_selection_strategy }} +{% endif -%} diff --git a/meet/templates/meet-config.js.j2 b/meet/templates/meet-config.js.j2 index acdb6cb..a4d383c 100644 --- a/meet/templates/meet-config.js.j2 +++ b/meet/templates/meet-config.js.j2 @@ -44,6 +44,11 @@ var config = { // testing: { +{% if jitsi_meet_octo_enabled -%} + octo: { + probability: 1 + }, +{% endif -%} // P2P test mode disables automatic switching to P2P when there are 2 // participants in the conference. p2pTestMode: false @@ -380,8 +385,8 @@ var config = { // the user region as seen by the server. deploymentInfo: { // shard: "shard1", - // region: "europe", - // userRegion: "asia" + region: "{{ jitsi_meet_octo_region }}", + userRegion: "{{ jitsi_meet_octo_region }}" }, // Decides whether the start/stop recording audio notifications should play on record. diff --git a/videobridge/defaults/main.yml b/videobridge/defaults/main.yml index dcafb71..979d81d 100644 --- a/videobridge/defaults/main.yml +++ b/videobridge/defaults/main.yml @@ -13,5 +13,11 @@ jitsi_meet_single_instance: "{{ inventory_hostname == groups['meet'][0] }}" jitsi_meet_videobridge_prosody_server_ip: "{{ jitsi_meet_single_instance | ternary('localhost', (hostvars[groups['meet'][0]]['private_ipv4'] | default(hostvars[groups['meet'][0]]['ansible_default_ipv4']['address']))) }}" jitsi_meet_videobridge_muc_nickname: "{{ jitsi_meet_single_instance | ternary('jvb1', ansible_hostname) }}" +# Octo +jitsi_meet_octo_enabled: False +jitsi_meet_octo_private_ip: "{{ ansible_default_ipv4.address }}" +jitsi_meet_octo_public_ip: "{{ ansible_default_ipv4.address }}" +jitsi_meet_octo_region: region1 + ## Logging jitsi_meet_videobridge_loglevel: "WARNING" diff --git a/videobridge/templates/videobridge/sip-communicator.properties.j2 b/videobridge/templates/videobridge/sip-communicator.properties.j2 index 7502f07..e772473 100644 --- a/videobridge/templates/videobridge/sip-communicator.properties.j2 +++ b/videobridge/templates/videobridge/sip-communicator.properties.j2 @@ -14,3 +14,13 @@ org.jitsi.videobridge.xmpp.user.shard.PASSWORD={{ jitsi_meet_videobridge_passwor org.jitsi.videobridge.xmpp.user.shard.MUC_JIDS=JvbBrewery@internal.auth.{{ jitsi_meet_server_name }} org.jitsi.videobridge.xmpp.user.shard.MUC_NICKNAME={{ jitsi_meet_videobridge_muc_nickname }} org.jitsi.videobridge.xmpp.user.shard.DISABLE_CERTIFICATE_VERIFICATION=true + +{% if jitsi_meet_octo_enabled -%} +# the address to bind to locally +org.jitsi.videobridge.octo.BIND_ADDRESS={{ jitsi_meet_octo_private_ip }} +# the address to advertise (in case BIND_ADDRESS is not accessible) +org.jitsi.videobridge.octo.PUBLIC_ADDRESS={{ jitsi_meet_octo_public_ip }} +# the port to bind to +org.jitsi.videobridge.octo.BIND_PORT=4096 +org.jitsi.videobridge.REGION={{ jitsi_meet_octo_region }} +{% endif -%} From 49efb41c65ce1c1cceb8283eb25321f0b26faa06 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Sun, 14 Feb 2021 22:46:38 +0100 Subject: [PATCH 6/8] make jicofo warning go away --- meet/templates/jicofo/sip-communicator.properties.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/meet/templates/jicofo/sip-communicator.properties.j2 b/meet/templates/jicofo/sip-communicator.properties.j2 index 11dc34e..658450a 100644 --- a/meet/templates/jicofo/sip-communicator.properties.j2 +++ b/meet/templates/jicofo/sip-communicator.properties.j2 @@ -2,4 +2,5 @@ org.jitsi.jicofo.BRIDGE_MUC=JvbBrewery@internal.auth.{{ jitsi_meet_server_name } {% if jitsi_meet_octo_enabled -%} org.jitsi.jicofo.BridgeSelector.BRIDGE_SELECTION_STRATEGY={{ jitsi_meet_octo_selection_strategy }} +org.jitsi.jicofo.SHORT_ID=1 {% endif -%} From 92d5ce097829e1637eacc7a15b62aa607a80130e Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Fri, 19 Feb 2021 12:36:03 +0100 Subject: [PATCH 7/8] make load packet-rate configurable --- videobridge/defaults/main.yml | 5 +++++ videobridge/templates/videobridge/jvb.conf.j2 | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/videobridge/defaults/main.yml b/videobridge/defaults/main.yml index 979d81d..751b0a9 100644 --- a/videobridge/defaults/main.yml +++ b/videobridge/defaults/main.yml @@ -19,5 +19,10 @@ jitsi_meet_octo_private_ip: "{{ ansible_default_ipv4.address }}" jitsi_meet_octo_public_ip: "{{ ansible_default_ipv4.address }}" jitsi_meet_octo_region: region1 +## The packet rate (pps) at which we'll consider the bridge overloaded +jitsi_meet_videobridge_load_threshold: 50000 +## The packet rate (pps) at which we'll consider the bridge 'underloaded' enough to start recovery +jitsi_meet_videobridge_recovery_threshold: 40000 + ## Logging jitsi_meet_videobridge_loglevel: "WARNING" diff --git a/videobridge/templates/videobridge/jvb.conf.j2 b/videobridge/templates/videobridge/jvb.conf.j2 index c36e349..b5f7eb5 100644 --- a/videobridge/templates/videobridge/jvb.conf.j2 +++ b/videobridge/templates/videobridge/jvb.conf.j2 @@ -10,4 +10,15 @@ videobridge { tls = true server-id = {{ ansible_hostname }} } + load-management { + load-measurements { + packet-rate { + # The packet rate at which we'll consider the bridge overloaded + load-threshold = {{ jitsi_meet_videobridge_load_threshold }} + # The packet rate at which we'll consider the bridge 'underloaded' enough + # to start recovery + recovery-threshold = {{ jitsi_meet_videobridge_recovery_threshold }} + } + } + } } From f64cf837c900e31cd4e6aca9d29e3c14460233c7 Mon Sep 17 00:00:00 2001 From: murmel <63870352+murme1@users.noreply.github.com> Date: Sat, 6 Mar 2021 21:38:10 +0100 Subject: [PATCH 8/8] make role backwards compatible --- meet/defaults/main.yml | 7 +++++-- meet/meta/main.yml | 2 ++ meet/tasks/jitsi-meet.yml | 2 +- meet/templates/nginx/sites-available/vhost.conf.j2 | 8 ++++---- meta/main.yml | 3 +++ videobridge/defaults/main.yml | 10 ++++++++-- videobridge/meta/main.yml | 5 +++-- 7 files changed, 26 insertions(+), 11 deletions(-) diff --git a/meet/defaults/main.yml b/meet/defaults/main.yml index 68f7832..adf75a3 100644 --- a/meet/defaults/main.yml +++ b/meet/defaults/main.yml @@ -1,5 +1,4 @@ --- - jitsi_meet_packages: - jicofo - jitsi-meet-prosody @@ -8,7 +7,11 @@ jitsi_meet_packages: jitsi_meet_server_name: "meet.example.com" -jitsi_meet_videobridge_instances: "{{ groups['videobridges'] }}" +## single server vs scalable setup +jitsi_meet_single_instance: True +jitsi_meet_videobridge_instances: + - name: 'default-id' + ip: 127.0.0.1 jitsi_meet_jicofo_user: focus jitsi_meet_jicofo_port: 5347 diff --git a/meet/meta/main.yml b/meet/meta/main.yml index 76c9fce..e740962 100644 --- a/meet/meta/main.yml +++ b/meet/meta/main.yml @@ -1,4 +1,6 @@ --- +galaxy_info: + role_name: meet dependencies: - role: systemli.apt_repositories vars: diff --git a/meet/tasks/jitsi-meet.yml b/meet/tasks/jitsi-meet.yml index 2e26863..055f2a7 100644 --- a/meet/tasks/jitsi-meet.yml +++ b/meet/tasks/jitsi-meet.yml @@ -33,7 +33,7 @@ vtype: string - name: jitsi-meet question: jitsi-meet/jvb-serve - value: "false" + value: "{{ jitsi_meet_single_instance | to_json }}" vtype: boolean - name: Install jitsi-meet diff --git a/meet/templates/nginx/sites-available/vhost.conf.j2 b/meet/templates/nginx/sites-available/vhost.conf.j2 index e851bac..1072021 100644 --- a/meet/templates/nginx/sites-available/vhost.conf.j2 +++ b/meet/templates/nginx/sites-available/vhost.conf.j2 @@ -94,15 +94,15 @@ server { } # colibri (JVB) websockets -{% for videobridge in jitsi_meet_videobridge_instances %} - location ~ ^/colibri-ws/{{ videobridge }}/(.*) { - proxy_pass http://{{ hostvars[videobridge]['private_ipv4'] | default(hostvars[videobridge]['ansible_default_ipv4']['address']) }}:9090/colibri-ws/{{ videobridge }}/$1$is_args$args; +{% for videobridge in jitsi_meet_videobridge_instances -%} + location ~ ^/colibri-ws/{{ videobridge.name }}/(.*) { + proxy_pass http://{{ videobridge.ip }}:9090/colibri-ws/{{ videobridge.name }}/$1$is_args$args; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; tcp_nodelay on; } -{% endfor %} +{% endfor -%} location ~ ^/([^/?&:'"]+)$ { try_files $uri @root_path; diff --git a/meta/main.yml b/meta/main.yml index 6eec090..d65af41 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -16,3 +16,6 @@ galaxy_info: - buster notifications: webhooks: https://galaxy.ansible.com/api/v1/notifications/ +dependencies: + - role: jitsi_meet/meet + - role: jitsi_meet/videobridge diff --git a/videobridge/defaults/main.yml b/videobridge/defaults/main.yml index 751b0a9..4e9b409 100644 --- a/videobridge/defaults/main.yml +++ b/videobridge/defaults/main.yml @@ -9,9 +9,15 @@ jitsi_meet_jicofo_user: focus jitsi_meet_videobridge_port: 5347 ## single server vs scalable setup -jitsi_meet_single_instance: "{{ inventory_hostname == groups['meet'][0] }}" -jitsi_meet_videobridge_prosody_server_ip: "{{ jitsi_meet_single_instance | ternary('localhost', (hostvars[groups['meet'][0]]['private_ipv4'] | default(hostvars[groups['meet'][0]]['ansible_default_ipv4']['address']))) }}" +jitsi_meet_single_instance: True +jitsi_meet_videobridge_prosody_server_ip: "localhost" jitsi_meet_videobridge_muc_nickname: "{{ jitsi_meet_single_instance | ternary('jvb1', ansible_hostname) }}" +_jitsi_meet_apt_repositories_pin_packages: + - jicofo + - jitsi-meet-prosody + - jitsi-meet-web + - jitsi-meet-web-config +jitsi_meet_apt_repositories_pin_packages: "{{ ['jitsi-videobridge2'] + (jitsi_meet_single_instance | ternary(_jitsi_meet_apt_repositories_pin_packages, [])) }}" # Octo jitsi_meet_octo_enabled: False diff --git a/videobridge/meta/main.yml b/videobridge/meta/main.yml index 7bdfb31..bcdaf18 100644 --- a/videobridge/meta/main.yml +++ b/videobridge/meta/main.yml @@ -1,9 +1,10 @@ --- +galaxy_info: + role_name: videobridge dependencies: - role: systemli.apt_repositories vars: apt_repositories: - preset: jitsi name: download_jitsi_org - packages: - - jitsi-videobridge2 + packages: "{{ jitsi_meet_apt_repositories_pin_packages }}"