mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	Optimized snipe-it und bbb
This commit is contained in:
		@@ -7,13 +7,13 @@
 | 
				
			|||||||
- name: "For '{{ application_id }}': Load database variables"
 | 
					- name: "For '{{ application_id }}': Load database variables"
 | 
				
			||||||
  include_vars: "{{ item }}"
 | 
					  include_vars: "{{ item }}"
 | 
				
			||||||
  loop:
 | 
					  loop:
 | 
				
			||||||
    - "{{ cmp_db_docker_vars_file_docker }}"   # Important to load docker variables first so that database can use them
 | 
					    - "{{ cmp_db_docker_vars_file_docker }}"  # Important to load docker variables first so that database can use them
 | 
				
			||||||
    - "{{ cmp_db_docker_vars_file_db }}" # Important to load them before docker role so that backup can use them
 | 
					    - "{{ cmp_db_docker_vars_file_db }}"      # Important to load them before docker role so that backup can use them
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "For '{{ application_id }}': Load docker-compose"
 | 
					- name: "For '{{ application_id }}': Load docker-compose"
 | 
				
			||||||
  include_role: 
 | 
					  include_role: 
 | 
				
			||||||
    name: docker-compose
 | 
					    name: docker-compose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "For '{{ application_id }}': Load central RDBMS"
 | 
					- name: "For '{{ application_id }}': Load central RDBMS"
 | 
				
			||||||
  include_role: 
 | 
					  include_role:
 | 
				
			||||||
    name: cmp-rdbms
 | 
					    name: cmp-rdbms
 | 
				
			||||||
@@ -1,12 +1,14 @@
 | 
				
			|||||||
# run_once_cmp_docker_proxy: deactivated
 | 
					# run_once_cmp_docker_proxy: deactivated
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "For '{{ application_id }}': include docker-compose role"
 | 
					# To load the proxy firs is just implemented due to some issues with BBB
 | 
				
			||||||
  include_role:
 | 
					 | 
				
			||||||
    name: docker-compose
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: "For '{{ application_id }}': include role srv-proxy-6-6-domain"
 | 
					- name: "For '{{ application_id }}': include role srv-proxy-6-6-domain"
 | 
				
			||||||
  include_role:
 | 
					  include_role:
 | 
				
			||||||
    name: srv-proxy-6-6-domain
 | 
					    name: srv-proxy-6-6-domain
 | 
				
			||||||
  vars:
 | 
					  vars:
 | 
				
			||||||
    domain:   "{{ domains | get_domain(application_id) }}"
 | 
					    domain:   "{{ domains | get_domain(application_id) }}"
 | 
				
			||||||
    http_port:   "{{ ports.localhost.http[application_id] }}"
 | 
					    http_port:   "{{ ports.localhost.http[application_id] }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: "For '{{ application_id }}': include docker-compose role"
 | 
				
			||||||
 | 
					  include_role:
 | 
				
			||||||
 | 
					    name: docker-compose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@
 | 
				
			|||||||
- name: Build docker 
 | 
					- name: Build docker 
 | 
				
			||||||
  command:
 | 
					  command:
 | 
				
			||||||
    cmd:   docker compose build
 | 
					    cmd:   docker compose build
 | 
				
			||||||
    chdir: "{{docker_repository_path}}"
 | 
					    chdir: "{{ docker_compose.directories.instance }}"
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    COMPOSE_HTTP_TIMEOUT: 600
 | 
					    COMPOSE_HTTP_TIMEOUT: 600
 | 
				
			||||||
    DOCKER_CLIENT_TIMEOUT: 600
 | 
					    DOCKER_CLIENT_TIMEOUT: 600
 | 
				
			||||||
@@ -21,7 +21,6 @@
 | 
				
			|||||||
    - docker compose build
 | 
					    - docker compose build
 | 
				
			||||||
    - docker compose up     # This is just here because I didn't took the time to refactor
 | 
					    - 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
 | 
					                            # @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
 | 
					  shell: docker-compose -p {{ application_id | get_entity_name }} up -d --force-recreate --remove-orphans
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,9 +4,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
- name: pull docker repository
 | 
					- name: pull docker repository
 | 
				
			||||||
  git:
 | 
					  git:
 | 
				
			||||||
    repo: "{{ docker_repository_address }}"
 | 
					    repo:       "{{ docker_repository_address }}"
 | 
				
			||||||
    dest: "{{ docker_repository_path }}"
 | 
					    dest:       "{{ docker_repository_path }}"
 | 
				
			||||||
    update: yes
 | 
					    depth:      1
 | 
				
			||||||
 | 
					    update:     yes
 | 
				
			||||||
 | 
					    recursive:  yes
 | 
				
			||||||
  notify:
 | 
					  notify:
 | 
				
			||||||
    - docker compose build
 | 
					    - docker compose build
 | 
				
			||||||
    - docker compose up
 | 
					    - docker compose up
 | 
				
			||||||
@@ -4,6 +4,11 @@
 | 
				
			|||||||
    chdir:        "{{ docker_compose.directories.instance }}"
 | 
					    chdir:        "{{ docker_compose.directories.instance }}"
 | 
				
			||||||
  register:       docker_ps
 | 
					  register:       docker_ps
 | 
				
			||||||
  changed_when:   (docker_ps.stdout | trim) == ""
 | 
					  changed_when:   (docker_ps.stdout | trim) == ""
 | 
				
			||||||
 | 
					  # The failed when catches the condition when an docker compose file will be dynamicly build after the file routine
 | 
				
			||||||
 | 
					  failed_when: >
 | 
				
			||||||
 | 
					    docker_ps.rc != 0
 | 
				
			||||||
 | 
					    and
 | 
				
			||||||
 | 
					    'no configuration file provided: not found' not in (docker_ps.stderr | default(''))
 | 
				
			||||||
  when: >
 | 
					  when: >
 | 
				
			||||||
    not (
 | 
					    not (
 | 
				
			||||||
      docker_compose_template.changed | default(false)
 | 
					      docker_compose_template.changed | default(false)
 | 
				
			||||||
@@ -4,7 +4,7 @@
 | 
				
			|||||||
  include_vars: "{{ docker_compose_variable_file }}"
 | 
					  include_vars: "{{ docker_compose_variable_file }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "reset (if enabled)"
 | 
					- name: "reset (if enabled)"
 | 
				
			||||||
  include_tasks: reset.yml 
 | 
					  include_tasks: 01_reset.yml 
 | 
				
			||||||
  when: mode_reset | bool
 | 
					  when: mode_reset | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This could lead to problems in docker-compose directories which are based on a git repository
 | 
					# This could lead to problems in docker-compose directories which are based on a git repository
 | 
				
			||||||
@@ -17,15 +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: "01_repository.yml"
 | 
					  include_tasks: "02_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: "02_files.yml"
 | 
					  include_tasks: "03_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"
 | 
					- name: "Ensure that {{ docker_compose.directories.instance }} is up"
 | 
				
			||||||
  include_tasks: "03_ensure_up.yml"
 | 
					  include_tasks: "04_ensure_up.yml"
 | 
				
			||||||
 | 
					  when: not docker_compose_skipp_file_creation | bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "flush database, docker and proxy for '{{ application_id }}'" 
 | 
					- name: "flush database, docker and proxy for '{{ application_id }}'" 
 | 
				
			||||||
  meta: flush_handlers
 | 
					  meta: flush_handlers
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,3 @@
 | 
				
			|||||||
# Todo
 | 
					# 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
 | 
				
			||||||
@@ -1,19 +1,16 @@
 | 
				
			|||||||
---
 | 
					 | 
				
			||||||
- name: create docker-compose.yml for bigbluebutton
 | 
					- name: create docker-compose.yml for bigbluebutton
 | 
				
			||||||
  command:
 | 
					  command:
 | 
				
			||||||
    cmd: bash ./scripts/generate-compose
 | 
					    cmd: bash ./scripts/generate-compose
 | 
				
			||||||
    chdir: "{{ bbb_repository_directory }}"
 | 
					    chdir: "{{ docker_repository_path }}"
 | 
				
			||||||
  environment:
 | 
					  environment:
 | 
				
			||||||
    COMPOSE_HTTP_TIMEOUT: 600
 | 
					    COMPOSE_HTTP_TIMEOUT: 600
 | 
				
			||||||
    DOCKER_CLIENT_TIMEOUT: 600
 | 
					    DOCKER_CLIENT_TIMEOUT: 600
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Copy docker-compose.yml from origin to final location
 | 
					- name: Copy docker-compose.yml from origin to final location
 | 
				
			||||||
  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
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Replace bind mounts by named volume mounts
 | 
					- name: Replace bind mounts by named volume mounts
 | 
				
			||||||
  replace:
 | 
					  replace:
 | 
				
			||||||
@@ -26,7 +23,6 @@
 | 
				
			|||||||
    - { regexp: '\./data/freeswitch-meetings:/var/freeswitch/meetings', replace: 'freeswitch:/var/freeswitch/meetings' }
 | 
					    - { 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/greenlight:/usr/src/app/storage', replace: 'greenlight:/usr/src/app/storage' }
 | 
				
			||||||
    - { regexp: '\./data/mediasoup:/var/mediasoup', replace: 'mediasoup:/var/mediasoup' }
 | 
					    - { regexp: '\./data/mediasoup:/var/mediasoup', replace: 'mediasoup:/var/mediasoup' }
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: add volume to redis
 | 
					- name: add volume to redis
 | 
				
			||||||
  lineinfile:
 | 
					  lineinfile:
 | 
				
			||||||
@@ -34,14 +30,12 @@
 | 
				
			|||||||
    insertafter: "^\\s*redis:"
 | 
					    insertafter: "^\\s*redis:"
 | 
				
			||||||
    line: "    volumes:\n      - redis:/data"
 | 
					    line: "    volumes:\n      - redis:/data"
 | 
				
			||||||
    firstmatch: yes
 | 
					    firstmatch: yes
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: add volume to coturn
 | 
					- name: add volume to coturn
 | 
				
			||||||
  lineinfile:
 | 
					  lineinfile:
 | 
				
			||||||
    path: "{{ docker_compose_file_final }}"
 | 
					    path: "{{ docker_compose_file_final }}"
 | 
				
			||||||
    insertafter: "- ./mod/coturn/turnserver.conf:/etc/coturn/turnserver.conf"
 | 
					    insertafter: "- ./mod/coturn/turnserver.conf:/etc/coturn/turnserver.conf"
 | 
				
			||||||
    line: "      - coturn:/var/lib/coturn"
 | 
					    line: "      - coturn:/var/lib/coturn"
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Implemented due to etherpad health bug.
 | 
					# Implemented due to etherpad health bug.
 | 
				
			||||||
# @todo Remove when health check is working fine
 | 
					# @todo Remove when health check is working fine
 | 
				
			||||||
@@ -67,14 +61,18 @@
 | 
				
			|||||||
        mediasoup:
 | 
					        mediasoup:
 | 
				
			||||||
    marker: "# {mark} ANSIBLE MANAGED BLOCK FOR VOLUMES"
 | 
					    marker: "# {mark} ANSIBLE MANAGED BLOCK FOR VOLUMES"
 | 
				
			||||||
    insertbefore: "^services:"
 | 
					    insertbefore: "^services:"
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Replace all './' with '/services/' in docker-compose.yml
 | 
					- name: Replace all './' with '/services/' in docker-compose.yml
 | 
				
			||||||
  ansible.builtin.replace:
 | 
					  ansible.builtin.replace:
 | 
				
			||||||
    path:     "{{ docker_compose_file_final }}"
 | 
					    path:     "{{ docker_compose_file_final }}"
 | 
				
			||||||
    regexp:   '\./'
 | 
					    regexp:   '\./'
 | 
				
			||||||
    replace:  './services/'
 | 
					    replace:  '{{ docker_repository_path }}/'
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					
 | 
				
			||||||
 | 
					- 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"
 | 
					- name: "Update healthcheck for bbb-graphql-server"
 | 
				
			||||||
  # This is neccessary because the healthcheck doesn't listen to the correct port
 | 
					  # 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"
 | 
					    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}}"
 | 
					    path: "{{docker_compose_file_final}}"
 | 
				
			||||||
    insertafter: "bbb-graphql-server:"
 | 
					    insertafter: "bbb-graphql-server:"
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: docker compose pull bigbluebutton
 | 
					- name: Add env_file to each service in docker-compose.yml
 | 
				
			||||||
  command:
 | 
					  blockinfile:
 | 
				
			||||||
    cmd: "docker-compose pull"
 | 
					    path: "{{ docker_compose_file_final }}"
 | 
				
			||||||
    chdir: "{{ bbb_repository_directory }}"
 | 
					    insertafter: '^  {{ service }}:$'
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					    marker: "# {mark} ANSIBLE MANAGED BLOCK FOR ENV_FILE"
 | 
				
			||||||
 | 
					    block: |
 | 
				
			||||||
- name: docker compose up bigbluebutton
 | 
					        env_file:
 | 
				
			||||||
  command:
 | 
					          - "{{ docker_compose.files.env }}"
 | 
				
			||||||
    cmd: "docker-compose -p bigbluebutton up -d --force-recreate --remove-orphans"
 | 
					  loop:
 | 
				
			||||||
    # Don't use the --build flag here. This leads to bugs
 | 
					    - bbb-web
 | 
				
			||||||
    chdir: "{{ docker_compose.directories.instance }}"
 | 
					    - freeswitch
 | 
				
			||||||
  environment:
 | 
					    - nginx
 | 
				
			||||||
    COMPOSE_HTTP_TIMEOUT: 600
 | 
					    - etherpad
 | 
				
			||||||
    DOCKER_CLIENT_TIMEOUT: 600
 | 
					    - bbb-pads
 | 
				
			||||||
  listen: setup bigbluebutton
 | 
					    - 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
 | 
				
			||||||
@@ -1,34 +1,12 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
# Docker Central Database Role can't be used here
 | 
					- name: "For '{{ application_id }}': include docker-compose role"
 | 
				
			||||||
- 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"
 | 
					 | 
				
			||||||
  include_role:
 | 
					  include_role:
 | 
				
			||||||
    name: srv-proxy-6-6-domain
 | 
					    name: cmp-docker-proxy
 | 
				
			||||||
 | 
					  vars:
 | 
				
			||||||
- name: pull docker repository
 | 
					    database_instance:  "{{ application_id }}"
 | 
				
			||||||
  git:
 | 
					    database_password:  "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret', True) }}"
 | 
				
			||||||
    repo: "https://github.com/bigbluebutton/docker.git"
 | 
					    database_username:  "postgres"
 | 
				
			||||||
    dest: "{{ bbb_repository_directory }}"
 | 
					    database_name:      ""                              # Multiple databases
 | 
				
			||||||
    update: yes
 | 
					 | 
				
			||||||
    recursive: yes
 | 
					 | 
				
			||||||
    version: main
 | 
					 | 
				
			||||||
  notify: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: configure websocket_upgrade.conf
 | 
					- name: configure websocket_upgrade.conf
 | 
				
			||||||
  copy: 
 | 
					  copy: 
 | 
				
			||||||
@@ -36,31 +14,26 @@
 | 
				
			|||||||
    dest: "{{nginx.directories.http.maps}}websocket_upgrade.conf"
 | 
					    dest: "{{nginx.directories.http.maps}}websocket_upgrade.conf"
 | 
				
			||||||
  notify: restart nginx
 | 
					  notify: restart nginx
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "Remove directory {{ docker_compose.directories.env }}"
 | 
					- name: "Set BBB Facts"
 | 
				
			||||||
  file:
 | 
					  set_fact:
 | 
				
			||||||
    path: "{{ docker_compose.directories.env }}"
 | 
					    bbb_env_file_link:            "{{ docker_repository_path }}.env"
 | 
				
			||||||
    state: absent
 | 
					    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
 | 
					- name: deploy .env
 | 
				
			||||||
  template: 
 | 
					  template: 
 | 
				
			||||||
    src:  env.j2
 | 
					    src:  env.j2
 | 
				
			||||||
    dest: "{{ bbb_env_file_origine }}"
 | 
					    dest: "{{ bbb_env_file_origine }}"
 | 
				
			||||||
  notify: setup bigbluebutton
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Create symbolic link from .env file to target location
 | 
					- name: Create symbolic link from .env file to target location
 | 
				
			||||||
  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
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name:           "Check if any container is running in {{ docker_compose.directories.instance }}"
 | 
					- name: "Setup docker-compose.yml file"
 | 
				
			||||||
  command:        docker compose ps -q --filter status=running
 | 
					  include_tasks: "docker-compose.yml"
 | 
				
			||||||
  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
 | 
				
			||||||
@@ -76,6 +49,6 @@
 | 
				
			|||||||
  command:
 | 
					  command:
 | 
				
			||||||
    cmd: docker compose exec greenlight bundle exec rake admin:create
 | 
					    cmd: docker compose exec greenlight bundle exec rake admin:create
 | 
				
			||||||
    chdir: "{{ docker_compose.directories.instance }}"
 | 
					    chdir: "{{ docker_compose.directories.instance }}"
 | 
				
			||||||
  when: bigbluebutton_setup
 | 
					  when: bbb_setup
 | 
				
			||||||
  ignore_errors: true
 | 
					  ignore_errors: true
 | 
				
			||||||
  register: admin_creation_result
 | 
					  register: admin_creation_result
 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
ENABLE_COTURN=true
 | 
					ENABLE_COTURN=true
 | 
				
			||||||
COTURN_TLS_CERT_PATH={{ certbot_cert_path }}/{{ ssl_cert_folder }}/fullchain.pem
 | 
					COTURN_TLS_CERT_PATH={{ certbot_cert_path }}/{{ ssl_cert_folder }}/fullchain.pem
 | 
				
			||||||
COTURN_TLS_KEY_PATH={{ certbot_cert_path }}/{{ ssl_cert_folder }}/privkey.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
 | 
					# Enable Webhooks
 | 
				
			||||||
# used by some integrations
 | 
					# used by some integrations
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,18 +1,18 @@
 | 
				
			|||||||
application_id:                           "web-app-bigbluebutton"
 | 
					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 configuration
 | 
				
			||||||
database_type:                            "postgres"
 | 
					database_type:                            "postgres"
 | 
				
			||||||
database_password:                        "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret') }}"
 | 
					database_password:                        "{{ applications | get_app_conf(application_id, 'credentials.postgresql_secret') }}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Proxy
 | 
				
			||||||
domain:                                   "{{ domains | get_domain(application_id) }}"
 | 
					domain:                                   "{{ domains | get_domain(application_id) }}"
 | 
				
			||||||
http_port:                                "{{ ports.localhost.http[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 
 | 
					# Setup 
 | 
				
			||||||
bigbluebutton_setup:                      "{{ applications | get_app_conf(application_id, 'setup') }}"
 | 
					bbb_setup:                                "{{ applications | get_app_conf(application_id, 'setup') }}"
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
application_id:             "web-app-port-ui"
 | 
					application_id:               "web-app-port-ui"
 | 
				
			||||||
docker_repository_address:  "https://github.com/kevinveenbirkenbach/port-ui"
 | 
					docker_repository_address:    "https://github.com/kevinveenbirkenbach/port-ui"
 | 
				
			||||||
config_inventory_path:      "{{ inventory_dir }}/files/{{ inventory_hostname }}/docker/web-app-port-ui/config.yaml.j2"
 | 
					config_inventory_path:        "{{ inventory_dir }}/files/{{ inventory_hostname }}/docker/web-app-port-ui/config.yaml.j2"
 | 
				
			||||||
docker_pull_git_repository:          true
 | 
					docker_pull_git_repository:   true
 | 
				
			||||||
@@ -12,27 +12,6 @@
 | 
				
			|||||||
  until: snipeit_admin_check.status == 200
 | 
					  until: snipeit_admin_check.status == 200
 | 
				
			||||||
  when: not ( applications | get_app_conf(application_id, 'features.oauth2', False))
 | 
					  when: not ( applications | get_app_conf(application_id, 'features.oauth2', False))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: "Debug: show APP_KEY in container shell"
 | 
					 | 
				
			||||||
  shell: |
 | 
					 | 
				
			||||||
    docker-compose exec -T \
 | 
					 | 
				
			||||||
      -u {{ snipe_it_user }} \
 | 
					 | 
				
			||||||
      -e XDG_CONFIG_HOME=/tmp \
 | 
					 | 
				
			||||||
      -e APP_KEY='{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}' \
 | 
					 | 
				
			||||||
      application \
 | 
					 | 
				
			||||||
      sh -c 'echo "SHELL sees APP_KEY=$APP_KEY"'
 | 
					 | 
				
			||||||
  args:
 | 
					 | 
				
			||||||
    chdir: "{{ docker_compose.directories.instance }}"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: "Debug: show APP_KEY in container shell"
 | 
					 | 
				
			||||||
  shell: |
 | 
					 | 
				
			||||||
    docker-compose exec -T -u {{ snipe_it_user }} \
 | 
					 | 
				
			||||||
    -e XDG_CONFIG_HOME=/tmp \
 | 
					 | 
				
			||||||
    -e APP_KEY="{{ applications | get_app_conf(application_id, 'credentials.app_key', True) }}" \
 | 
					 | 
				
			||||||
    application \
 | 
					 | 
				
			||||||
    php artisan tinker --execute="echo 'CONFIG app.key: ' . config('app.key') . PHP_EOL;"
 | 
					 | 
				
			||||||
  args:
 | 
					 | 
				
			||||||
    chdir: "{{ docker_compose.directories.instance }}"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- name: "Set all LDAP settings via Laravel Setting model (inside container as {{ snipe_it_user }})"
 | 
					- name: "Set all LDAP settings via Laravel Setting model (inside container as {{ snipe_it_user }})"
 | 
				
			||||||
  shell: |
 | 
					  shell: |
 | 
				
			||||||
    docker-compose exec -T \
 | 
					    docker-compose exec -T \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,14 @@
 | 
				
			|||||||
 | 
					# General 
 | 
				
			||||||
application_id:     "web-app-snipe-it"
 | 
					application_id:     "web-app-snipe-it"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Database
 | 
				
			||||||
database_password:  "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
 | 
					database_password:  "{{ applications | get_app_conf(application_id, 'credentials.database_password', True) }}"
 | 
				
			||||||
database_type:      "mariadb"
 | 
					database_type:      "mariadb"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Docker
 | 
				
			||||||
 | 
					docker_compose_flush_handlers:          true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Snipe-IT specific
 | 
				
			||||||
snipe_it_url:       "{{ domains | get_url(application_id, web_protocol) }}"
 | 
					snipe_it_url:       "{{ domains | get_url(application_id, web_protocol) }}"
 | 
				
			||||||
snipe_it_version:   "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.version', True) }}"
 | 
					snipe_it_version:   "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.version', True) }}"
 | 
				
			||||||
snipe_it_image:     "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.image', True) }}"
 | 
					snipe_it_image:     "{{ applications | get_app_conf(application_id, 'docker.services.snipe-it.image', True) }}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,7 +13,7 @@ database_type:                          0                       # Database type
 | 
				
			|||||||
docker_compose_flush_handlers:          true                    # When this is set to true an auto-flush after the docker-compose.yml, and env deploy is triggered, otherwise you have todo it manual.
 | 
					docker_compose_flush_handlers:          true                    # When this is set to true an auto-flush after the docker-compose.yml, and env deploy is triggered, otherwise you have todo it manual.
 | 
				
			||||||
docker_compose_skipp_file_creation:     false                   # Skipp creation of docker-compose.yml file
 | 
					docker_compose_skipp_file_creation:     false                   # Skipp creation of docker-compose.yml file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
docker_pull_git_repository:                      true                    # This will automaticly pull a repository from the 'docker_repository_address'
 | 
					docker_pull_git_repository:             true                    # This will automaticly pull a repository from the 'docker_repository_address'
 | 
				
			||||||
docker_repository_address:              ""                      # The address of a repository which should be pulled
 | 
					docker_repository_address:              ""                      # The address of a repository which should be pulled
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{# The following variable mapping is optional, but it makes it easier to read the code.#}
 | 
					{# The following variable mapping is optional, but it makes it easier to read the code.#}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user