Finished bbb implementation

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-20 20:07:43 +02:00
parent a580f41edd
commit ed866bf177
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
7 changed files with 48 additions and 34 deletions

View File

@ -1,12 +1,4 @@
--- ---
- name: rebuild docker repository
command:
cmd: docker compose build
chdir: "{{docker_repository_path}}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600
- name: Validate Docker Compose configuration - name: Validate Docker Compose configuration
command: command:
cmd: docker compose -f {{ docker_compose.files.docker_compose }} config --quiet cmd: docker compose -f {{ docker_compose.files.docker_compose }} config --quiet
@ -18,8 +10,21 @@
- docker compose up - docker compose up
- docker compose restart - docker compose restart
- name: Build docker
command:
cmd: docker compose build
chdir: "{{docker_repository_path}}"
environment:
COMPOSE_HTTP_TIMEOUT: 600
DOCKER_CLIENT_TIMEOUT: 600
listen:
- docker compose build
- docker compose up # This is just here because I didn't took the time to refactor
# @todo go over all docker compose up implementations and check where it makes sense to user docker compose build and where docker compose up
when: application_id != 'web-app-bigbluebutton' # @todo solve this on a different way, just a fast hack
- name: docker compose up - name: docker compose up
shell: docker-compose -p {{ application_id | get_entity_name }} up -d --force-recreate --remove-orphans --build shell: docker-compose -p {{ application_id | get_entity_name }} up -d --force-recreate --remove-orphans
args: args:
chdir: "{{ docker_compose.directories.instance }}" chdir: "{{ docker_compose.directories.instance }}"
executable: /bin/bash executable: /bin/bash

View File

@ -8,6 +8,6 @@
dest: "{{ docker_repository_path }}" dest: "{{ docker_repository_path }}"
update: yes update: yes
notify: notify:
- docker compose build
- docker compose up - docker compose up
- rebuild docker repository
become: true become: true

View File

@ -32,13 +32,3 @@
dest: "{{ docker_compose.files.docker_compose }}" dest: "{{ docker_compose.files.docker_compose }}"
notify: docker compose up notify: docker compose up
register: docker_compose_template register: docker_compose_template
- 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: docker compose up
when: not (docker_compose_template.changed or env_template.changed)
ignore_errors: true

View File

@ -0,0 +1,13 @@
- 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) == ""
when: >
not (
docker_compose_template.changed | default(false)
or
env_template.changed | default(false)
)
notify: docker compose up

View File

@ -17,13 +17,16 @@
with_dict: "{{ docker_compose.directories }}" with_dict: "{{ docker_compose.directories }}"
- name: "Include routines to set up a git repository based installaion for '{{application_id}}'." - name: "Include routines to set up a git repository based installaion for '{{application_id}}'."
include_tasks: "repository.yml" include_tasks: "01_repository.yml"
when: docker_pull_git_repository | bool when: docker_pull_git_repository | bool
- name: "Include routines file management routines for '{{application_id}}'." - name: "Include routines file management routines for '{{application_id}}'."
include_tasks: "files.yml" include_tasks: "02_files.yml"
when: not docker_compose_skipp_file_creation | bool when: not docker_compose_skipp_file_creation | bool
- name: "Ensure that {{ docker_compose.directories.instance }} is up"
include_tasks: "03_ensure_up.yml"
- name: "flush database, docker and proxy for '{{ application_id }}'" - name: "flush database, docker and proxy for '{{ application_id }}'"
meta: flush_handlers meta: flush_handlers
when: docker_compose_flush_handlers | bool when: docker_compose_flush_handlers | bool

View File

@ -9,14 +9,14 @@
listen: setup bigbluebutton listen: setup bigbluebutton
- name: Copy docker-compose.yml from origin to final location - name: Copy docker-compose.yml from origin to final location
ansible.builtin.copy: copy:
src: "{{ docker_compose_file_origine }}" src: "{{ docker_compose_file_origine }}"
dest: "{{ docker_compose_file_final }}" dest: "{{ docker_compose_file_final }}"
remote_src: yes remote_src: yes
listen: setup bigbluebutton listen: setup bigbluebutton
- name: Replace bind mounts by named volume mounts - name: Replace bind mounts by named volume mounts
ansible.builtin.replace: replace:
path: "{{ docker_compose_file_final }}" path: "{{ docker_compose_file_final }}"
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}" replace: "{{ item.replace }}"

View File

@ -37,7 +37,7 @@
notify: restart nginx notify: restart nginx
- name: "Remove directory {{ docker_compose.directories.env }}" - name: "Remove directory {{ docker_compose.directories.env }}"
ansible.builtin.file: file:
path: "{{ docker_compose.directories.env }}" path: "{{ docker_compose.directories.env }}"
state: absent state: absent
@ -48,12 +48,20 @@
notify: setup bigbluebutton notify: setup bigbluebutton
- name: Create symbolic link from .env file to target location - name: Create symbolic link from .env file to target location
ansible.builtin.file: file:
src: "{{ bbb_env_file_origine }}" src: "{{ bbb_env_file_origine }}"
dest: "{{ bbb_env_file_link }}" dest: "{{ bbb_env_file_link }}"
state: link state: link
notify: setup bigbluebutton 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: flush docker service - name: flush docker service
meta: flush_handlers meta: flush_handlers
@ -62,7 +70,7 @@
host: "{{ domains | get_domain('web-app-bigbluebutton') }}" host: "{{ domains | get_domain('web-app-bigbluebutton') }}"
port: 80 port: 80
delay: 5 delay: 5
timeout: 600 timeout: 300
- name: create admin - name: create admin
command: command:
@ -71,8 +79,3 @@
when: bigbluebutton_setup when: bigbluebutton_setup
ignore_errors: true ignore_errors: true
register: admin_creation_result register: admin_creation_result
- name: print admin user data
debug:
msg: "{{ admin_creation_result.stdout }}"
when: bigbluebutton_setup