mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-22 08:11:09 +02:00
Finished bbb implementation
This commit is contained in:
parent
a580f41edd
commit
ed866bf177
@ -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
|
||||
command:
|
||||
cmd: docker compose -f {{ docker_compose.files.docker_compose }} config --quiet
|
||||
@ -18,8 +10,21 @@
|
||||
- docker compose up
|
||||
- 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
|
||||
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:
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
executable: /bin/bash
|
||||
|
@ -8,6 +8,6 @@
|
||||
dest: "{{ docker_repository_path }}"
|
||||
update: yes
|
||||
notify:
|
||||
- docker compose build
|
||||
- docker compose up
|
||||
- rebuild docker repository
|
||||
become: true
|
@ -31,14 +31,4 @@
|
||||
src: "docker-compose.yml.j2"
|
||||
dest: "{{ docker_compose.files.docker_compose }}"
|
||||
notify: docker compose up
|
||||
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
|
||||
register: docker_compose_template
|
13
roles/docker-compose/tasks/03_ensure_up.yml
Normal file
13
roles/docker-compose/tasks/03_ensure_up.yml
Normal 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
|
@ -17,13 +17,16 @@
|
||||
with_dict: "{{ docker_compose.directories }}"
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
|
||||
- name: "Ensure that {{ docker_compose.directories.instance }} is up"
|
||||
include_tasks: "03_ensure_up.yml"
|
||||
|
||||
- name: "flush database, docker and proxy for '{{ application_id }}'"
|
||||
meta: flush_handlers
|
||||
when: docker_compose_flush_handlers | bool
|
||||
|
@ -9,14 +9,14 @@
|
||||
listen: setup bigbluebutton
|
||||
|
||||
- name: Copy docker-compose.yml from origin to final location
|
||||
ansible.builtin.copy:
|
||||
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
|
||||
ansible.builtin.replace:
|
||||
replace:
|
||||
path: "{{ docker_compose_file_final }}"
|
||||
regexp: "{{ item.regexp }}"
|
||||
replace: "{{ item.replace }}"
|
||||
|
@ -37,7 +37,7 @@
|
||||
notify: restart nginx
|
||||
|
||||
- name: "Remove directory {{ docker_compose.directories.env }}"
|
||||
ansible.builtin.file:
|
||||
file:
|
||||
path: "{{ docker_compose.directories.env }}"
|
||||
state: absent
|
||||
|
||||
@ -48,12 +48,20 @@
|
||||
notify: setup bigbluebutton
|
||||
|
||||
- name: Create symbolic link from .env file to target location
|
||||
ansible.builtin.file:
|
||||
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: flush docker service
|
||||
meta: flush_handlers
|
||||
|
||||
@ -62,7 +70,7 @@
|
||||
host: "{{ domains | get_domain('web-app-bigbluebutton') }}"
|
||||
port: 80
|
||||
delay: 5
|
||||
timeout: 600
|
||||
timeout: 300
|
||||
|
||||
- name: create admin
|
||||
command:
|
||||
@ -70,9 +78,4 @@
|
||||
chdir: "{{ docker_compose.directories.instance }}"
|
||||
when: bigbluebutton_setup
|
||||
ignore_errors: true
|
||||
register: admin_creation_result
|
||||
|
||||
- name: print admin user data
|
||||
debug:
|
||||
msg: "{{ admin_creation_result.stdout }}"
|
||||
when: bigbluebutton_setup
|
||||
register: admin_creation_result
|
Loading…
x
Reference in New Issue
Block a user