Optimized snipe-it und bbb

This commit is contained in:
2025-07-21 01:40:42 +02:00
parent 6e2e3e45a7
commit 5343536d27
17 changed files with 102 additions and 121 deletions

View File

@@ -1,2 +1,3 @@
# Todo
- Propper implement and test the LDAP integration, the configuration values just had been set during refactoring
- Propper implement and test the LDAP integration, the configuration values just had been set during refactoring
- Move this whole overcomplicated handlers to the copying of a docker-compose.yml file. This is just legacy stuff

View File

@@ -1,19 +1,16 @@
---
- name: create docker-compose.yml for bigbluebutton
command:
cmd: bash ./scripts/generate-compose
chdir: "{{ bbb_repository_directory }}"
chdir: "{{ docker_repository_path }}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600
listen: setup bigbluebutton
- name: Copy docker-compose.yml from origin to final location
copy:
src: "{{ docker_compose_file_origine }}"
dest: "{{ docker_compose_file_final }}"
remote_src: yes
listen: setup bigbluebutton
- name: Replace bind mounts by named volume mounts
replace:
@@ -26,7 +23,6 @@
- { regexp: '\./data/freeswitch-meetings:/var/freeswitch/meetings', replace: 'freeswitch:/var/freeswitch/meetings' }
- { regexp: '\./data/greenlight:/usr/src/app/storage', replace: 'greenlight:/usr/src/app/storage' }
- { regexp: '\./data/mediasoup:/var/mediasoup', replace: 'mediasoup:/var/mediasoup' }
listen: setup bigbluebutton
- name: add volume to redis
lineinfile:
@@ -34,14 +30,12 @@
insertafter: "^\\s*redis:"
line: " volumes:\n - redis:/data"
firstmatch: yes
listen: setup bigbluebutton
- name: add volume to coturn
lineinfile:
path: "{{ docker_compose_file_final }}"
insertafter: "- ./mod/coturn/turnserver.conf:/etc/coturn/turnserver.conf"
line: " - coturn:/var/lib/coturn"
listen: setup bigbluebutton
# Implemented due to etherpad health bug.
# @todo Remove when health check is working fine
@@ -67,14 +61,18 @@
mediasoup:
marker: "# {mark} ANSIBLE MANAGED BLOCK FOR VOLUMES"
insertbefore: "^services:"
listen: setup bigbluebutton
- name: Replace all './' with '/services/' in docker-compose.yml
ansible.builtin.replace:
path: "{{ docker_compose_file_final }}"
regexp: '\./'
replace: './services/'
listen: setup bigbluebutton
replace: '{{ docker_repository_path }}/'
- name: Prefix build context with docker_repository_path
ansible.builtin.replace:
path: "{{ docker_compose_file_final }}"
regexp: '(^\s*context:\s*)mod/(.*)'
replace: '\1{{ docker_repository_path }}/mod/\2'
- name: "Update healthcheck for bbb-graphql-server"
# This is neccessary because the healthcheck doesn't listen to the correct port
@@ -82,20 +80,33 @@
line: " healthcheck:\n test: [\"CMD\", \"curl\", \"-f\", \"http://localhost:8085/healthz\"]\n interval: 30s\n timeout: 10s\n retries: 5\n start_period: 10s"
path: "{{docker_compose_file_final}}"
insertafter: "bbb-graphql-server:"
listen: setup bigbluebutton
- name: docker compose pull bigbluebutton
command:
cmd: "docker-compose pull"
chdir: "{{ bbb_repository_directory }}"
listen: setup bigbluebutton
- name: docker compose up bigbluebutton
command:
cmd: "docker-compose -p bigbluebutton up -d --force-recreate --remove-orphans"
# Don't use the --build flag here. This leads to bugs
chdir: "{{ docker_compose.directories.instance }}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600
listen: setup bigbluebutton
- name: Add env_file to each service in docker-compose.yml
blockinfile:
path: "{{ docker_compose_file_final }}"
insertafter: '^ {{ service }}:$'
marker: "# {mark} ANSIBLE MANAGED BLOCK FOR ENV_FILE"
block: |
env_file:
- "{{ docker_compose.files.env }}"
loop:
- bbb-web
- freeswitch
- nginx
- etherpad
- bbb-pads
- bbb-export-annotations
- redis
- webrtc-sfu
- fsesl-akka
- apps-akka
- bbb-graphql-server
- bbb-graphql-actions
- bbb-graphql-middleware
- collabora
- periodic
- coturn
- greenlight
- postgres
loop_control:
loop_var: service

View File

@@ -1,34 +1,12 @@
---
# Docker Central Database Role can't be used here
- name: "include docker-compose role"
include_role:
name: docker-compose
vars:
database_instance: "{{ application_id }}"
database_password: "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret', True) }}"
database_username: "postgres"
database_name: "" # Multiple databases
- name: "Seed BigBlueButton Database for Backup"
include_tasks: "{{ playbook_dir }}/roles/sys-bkp-docker-2-loc/tasks/seed-database-to-backup.yml"
vars:
database_instance: "{{ application_id }}"
database_password: "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret', True) }}"
database_username: "postgres"
database_name: "" # Multiple databases
- name: "include role srv-proxy-6-6-domain"
- name: "For '{{ application_id }}': include docker-compose role"
include_role:
name: srv-proxy-6-6-domain
- name: pull docker repository
git:
repo: "https://github.com/bigbluebutton/docker.git"
dest: "{{ bbb_repository_directory }}"
update: yes
recursive: yes
version: main
notify: setup bigbluebutton
name: cmp-docker-proxy
vars:
database_instance: "{{ application_id }}"
database_password: "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret', True) }}"
database_username: "postgres"
database_name: "" # Multiple databases
- name: configure websocket_upgrade.conf
copy:
@@ -36,31 +14,26 @@
dest: "{{nginx.directories.http.maps}}websocket_upgrade.conf"
notify: restart nginx
- name: "Remove directory {{ docker_compose.directories.env }}"
file:
path: "{{ docker_compose.directories.env }}"
state: absent
- name: "Set BBB Facts"
set_fact:
bbb_env_file_link: "{{ docker_repository_path }}.env"
bbb_env_file_origine: "{{ docker_compose.files.env }}"
docker_compose_file_origine: "{{ docker_repository_path }}docker-compose.yml"
docker_compose_file_final: "{{ docker_compose.directories.instance }}docker-compose.yml"
- name: deploy .env
template:
src: env.j2
dest: "{{ bbb_env_file_origine }}"
notify: setup bigbluebutton
- name: Create symbolic link from .env file to target location
file:
src: "{{ bbb_env_file_origine }}"
dest: "{{ bbb_env_file_link }}"
state: link
notify: setup bigbluebutton
- name: "Check if any container is running in {{ docker_compose.directories.instance }}"
command: docker compose ps -q --filter status=running
args:
chdir: "{{ docker_compose.directories.instance }}"
register: docker_ps
changed_when: (docker_ps.stdout | trim) == ""
notify: setup bigbluebutton
- name: "Setup docker-compose.yml file"
include_tasks: "docker-compose.yml"
- name: flush docker service
meta: flush_handlers
@@ -76,6 +49,6 @@
command:
cmd: docker compose exec greenlight bundle exec rake admin:create
chdir: "{{ docker_compose.directories.instance }}"
when: bigbluebutton_setup
when: bbb_setup
ignore_errors: true
register: admin_creation_result

View File

@@ -1,7 +1,7 @@
ENABLE_COTURN=true
COTURN_TLS_CERT_PATH={{ certbot_cert_path }}/{{ ssl_cert_folder }}/fullchain.pem
COTURN_TLS_KEY_PATH={{ certbot_cert_path }}/{{ ssl_cert_folder }}/privkey.pem
ENABLE_GREENLIGHT={{applications | get_app_conf(application_id, 'enable_greenlight', True)}}
ENABLE_GREENLIGHT={{ applications | get_app_conf(application_id, 'enable_greenlight', True) }}
# Enable Webhooks
# used by some integrations

View File

@@ -1,18 +1,18 @@
application_id: "web-app-bigbluebutton"
bbb_repository_directory: "{{ docker_compose.directories.services }}"
docker_compose_file_origine: "{{ docker_compose.directories.services }}docker-compose.yml"
docker_compose_file_final: "{{ docker_compose.directories.instance }}docker-compose.yml"
# Database configuration
database_type: "postgres"
database_password: "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret') }}"
# Proxy
domain: "{{ domains | get_domain(application_id) }}"
http_port: "{{ ports.localhost.http[application_id] }}"
bbb_env_file_link: "{{ docker_compose.directories.instance }}.env"
bbb_env_file_origine: "{{ bbb_repository_directory }}.env"
docker_compose_skipp_file_creation: true # Skipp creation of docker-compose.yml file
# Docker
docker_compose_skipp_file_creation: true # Handled in this role
docker_repository_address: "https://github.com/bigbluebutton/docker.git"
docker_pull_git_repository: true
docker_compose_flush_handlers: false
# Setup
bigbluebutton_setup: "{{ applications | get_app_conf(application_id, 'setup') }}"
bbb_setup: "{{ applications | get_app_conf(application_id, 'setup') }}"