diff --git a/roles/web-app-bigbluebutton/tasks/02_administrator.yml b/roles/web-app-bigbluebutton/tasks/02_administrator.yml index 4041bae3..409c34f3 100644 --- a/roles/web-app-bigbluebutton/tasks/02_administrator.yml +++ b/roles/web-app-bigbluebutton/tasks/02_administrator.yml @@ -1,8 +1,23 @@ +- name: "Wait until Greenlight is reachable via Nginx" + uri: + url: "{{ domains | get_url(application_id, WEB_PROTOCOL) }}" + validate_certs: true + status_code: 200 + return_content: true + register: greenlight_http + until: + - greenlight_http.status == 200 + - "'Greenlight' in greenlight_http.content or 'Sign in' in greenlight_http.content" + retries: 30 + delay: 5 + changed_when: false + - block: - name: "Create default admin" command: - cmd: docker compose exec greenlight \ - bundle exec rake admin:create['{{ users.administrator.username | upper }}','{{ users.administrator.email }}','{{ users.administrator.password }}'] + cmd: > + docker compose exec greenlight + bundle exec rake admin:create['{{ users.administrator.username | upper }}','{{ users.administrator.email }}','{{ users.administrator.password }}'] chdir: "{{ docker_compose.directories.instance }}" register: admin_creation_result # Treat exit codes 0 (created) and 2 (already exists) as success diff --git a/roles/web-app-bigbluebutton/tasks/main.yml b/roles/web-app-bigbluebutton/tasks/main.yml index 22035ce7..c06a2c15 100644 --- a/roles/web-app-bigbluebutton/tasks/main.yml +++ b/roles/web-app-bigbluebutton/tasks/main.yml @@ -40,24 +40,6 @@ - name: flush docker service meta: flush_handlers -- name: "Get greenlight container name" - shell: | - docker compose ps -q greenlight - args: - chdir: "{{ docker_compose.directories.instance }}" - register: greenlight_id - -- name: "Wait until BigBlueButton (greenlight) is running" - shell: | - docker inspect --format='{{'{{'}}.State.Status{{'}}'}}' {{ greenlight_id.stdout }} - args: - chdir: "{{ docker_compose.directories.instance }}" - register: bbb_state - until: bbb_state.stdout.strip() == "running" - retries: 30 - delay: 5 - changed_when: false - - name: "Setup administrator" include_tasks: "02_administrator.yml" diff --git a/roles/web-app-bigbluebutton/templates/env.j2 b/roles/web-app-bigbluebutton/templates/env.j2 index 1bfe2506..087d3afc 100644 --- a/roles/web-app-bigbluebutton/templates/env.j2 +++ b/roles/web-app-bigbluebutton/templates/env.j2 @@ -39,13 +39,13 @@ FSESL_PASSWORD={{applications | get_app_conf(application_id, 'credentials.fsesl_ DOMAIN={{domains | get_domain(application_id)}} -EXTERNAL_IPv4={{networks.internet.ip4}} +EXTERNAL_IPv4={{ networks.internet.ip4 }} # The following line is not tested and could lead to bugs: -EXTERNAL_IPv6={{networks.internet.ip6}} +EXTERNAL_IPv6={{ networks.internet.ip6 }} # STUN SERVER # stun.freeswitch.org -STUN_IP={{networks.internet.ip4}} +STUN_IP={{ networks.internet.ip4 }} STUN_PORT={{ ports.public.stun[application_id] }} # TURN SERVER