How To deploy an anible-role-bigbluebutton
cluster with the Proxy Setup
bbb_lbmode:
# Loadbalancer domain name (e.g. example.com)
host: "{{ bbblb_domain }}"
# Node name (e.g. bbb01, defaults to subdomain)
name: "{{ bbb_nodename | default(inventory_hostname.split('.')[0]) }}"
- name: Enable lbmode
when: "bbb_lbmode|default(False)"
set_fact:
bbb_meteor: |
{{bbb_meteor|default({})|combine({
'public': {
'app': {
'basename': "/"+bbb_lbmode.name+"/html5client",
'bbbWebBase': 'https://'+bbb_hostname+'/bigbluebutton',
'learningDashboardBase': 'https://'+bbb_hostname+'/learning-dashboard',
'userSettingsStorage': 'local',
},
'media': {
'stunTurnServersFetchAddress': 'https://'+bbb_hostname+'/bigbluebutton/api/stuns',
'sip_ws_host': bbb_hostname,
},
'presentation': {
'uploadEndpoint': 'https://'+bbb_hostname+'/bigbluebutton/presentation/upload'
},
'pads': {
'url': 'https://'+bbb_hostname+'/pad'
}
}
}, recursive=True)}}
- name: lbmode for /etc/bigbluebutton/bbb-web.properties
ansible.builtin.lineinfile:
path: /etc/bigbluebutton/bbb-web.properties
regexp: "^{{item.split('=')[0]}}="
line: "{{item}}"
loop:
- defaultHTML5ClientUrl=https://{{bbb_lbmode.host}}/{{bbb_lbmode.name}}/html5client/join
- defaultGuestWaitURL=https://{{bbb_lbmode.host}}/{{bbb_lbmode.name}}/html5client/guestWait
- presentationBaseURL=https://{{bbb_hostname}}/bigbluebutton/presentation
- accessControlAllowOrigin=https://{{bbb_lbmode.host}}
notify:
- restart bbb
- name: lbmode override meteor ROOT_URL
ansible.builtin.copy:
dest: "{{item}}"
content: |
[Service]
Environment=ROOT_URL=https://{{bbb_lbmode.host}}/{{bbb_lbmode.name}}/html5client
Environment=DDP_DEFAULT_CONNECTION_URL=https://{{bbb_hostname}}/{{bbb_lbmode.name}}/html5client
loop:
- /etc/systemd/system/[email protected]/cluster.conf
- /etc/systemd/system/[email protected]/cluster.conf
notify:
- reload systemd
- restart bbb
- name: lbmode configure etherpad
ansible.builtin.copy:
dest: "/etc/bigbluebutton/etherpad.json"
content: '{"cluster_proxies": ["https://{{bbb_lbmode.host}}"]}'
notify:
- restart bbb
- name: lbmode set nginx bbb_loadbalancer_node
ansible.builtin.copy:
dest: "/usr/share/bigbluebutton/nginx/loadbalancer.nginx"
content: "set $bbb_loadbalancer_node https://{{bbb_lbmode.host}};"
notify:
- reload nginx
- name: lbmode fix /usr/share/bigbluebutton/nginx/bbb-html5.nginx
ansible.builtin.replace:
path: /usr/share/bigbluebutton/nginx/bbb-html5.nginx
regexp: 'location (/[^/]+)?/html5client'
replace: "location /{{bbb_lbmode.name}}/html5client"
notify:
- reload nginx
- name: lbmode fix /etc/default/bbb-web
ansible.builtin.lineinfile:
path: /etc/default/bbb-web
regexp: '^JDK_JAVA_OPTIONS=.*'
line: 'JDK_JAVA_OPTIONS="-Dgrails.cors.enabled=true -Dgrails.cors.allowCredentials=true -Dgrails.cors.allowedOrigins=https://{{bbb_hostname}},https://{{bbb_lbmode.host}}"'
notify:
- restart bbb
- name: lbmode custom guest-wait.html
ansible.builtin.template:
src: guest-wait.html.j2
dest: /usr/share/meteor/bundle/programs/server/assets/app/static/guest-wait/guest-wait.html
notify:
- restart bbb
...
<script type="text/javascript">
{% if bbb_lbmode|default(False) %}
const CLIENT_BASE = "https://{{bbb_lbmode.host}}/{{bbb_lbmode.name}}/html5client"
{% else %}
const CLIENT_BASE = "https://{{bbb_hostname}}/html5client"
{% endif %}
const API_BASE = "https://{{bbb_hostname}}/bigbluebutton/api"
{% for host in groups['bbb'] %}
{% if hostvars[host].get('bbb_lbmode') %}
location /{{hostvars[host].bbb_lbmode.name}}/html5client/ {
proxy_pass https://{{host}};
}
{% endif %}
{% endfor %}