Adjusted variables and docker-compose file to account for multitenancy setups.

This commit is contained in:
Joschka Seydell 2020-11-30 13:34:36 -08:00
parent 83cec2905c
commit 40049b2e3e
3 changed files with 12 additions and 5 deletions

View file

@ -30,7 +30,9 @@ Role Variables
| --------------------------- | ------------------------------------------------------------------------------- | ------------------ | | --------------------------- | ------------------------------------------------------------------------------- | ------------------ |
| collabora_install_user | The user who is going to manage/run the Docker Compose services | {{ ansible_user }} | | collabora_install_user | The user who is going to manage/run the Docker Compose services | {{ ansible_user }} |
| collabora_install_path | The location where the service should be deployed | /home/{{ collabora_install_user }} | | collabora_install_path | The location where the service should be deployed | /home/{{ collabora_install_user }} |
| collabora_multitenant_label | A label (unique accross all instances on this host) identifying the tenant | |
| collabora_virtual_host | The host under which CODE is available from the outside (e.g. collabora.example.org) | localhost | | collabora_virtual_host | The host under which CODE is available from the outside (e.g. collabora.example.org) | localhost |
| collabora_exposed_port | The port under which the Collabora instance is available | 9980 |
| collabora_domain_regex_pattern | A regular expression to match hosts that should be allowed to access CODE | localhost | | collabora_domain_regex_pattern | A regular expression to match hosts that should be allowed to access CODE | localhost |
| collabora_admin_user | Used to access to the Admin UI: https://<code-server>/loleaflet/dist/admin/admin.html | | | collabora_admin_user | Used to access to the Admin UI: https://<code-server>/loleaflet/dist/admin/admin.html | |
| collabora_admin_password | | | | collabora_admin_password | | |

View file

@ -2,7 +2,10 @@
# defaults file for Collabora Online # defaults file for Collabora Online
collabora_install_user: '{{ ansible_user }}' # This user must be present on the host collabora_install_user: '{{ ansible_user }}' # This user must be present on the host
collabora_install_path: '/home/{{ collabora_install_user }}' collabora_install_path: '/home/{{ collabora_install_user }}'
collabora_multitenant_label:
collabora_exposed_port: 9980 collabora_exposed_port: 9980
collabora_virtual_host: localhost collabora_virtual_host: localhost
collabora_public_url: http://{{ collabora_virtual_host }} collabora_public_url: http://{{ collabora_virtual_host }}
collabora_domain_regex_pattern: localhost collabora_domain_regex_pattern: localhost
# Internal variables
collabora_multitenant_postfix: "{{ '_' + collabora_multitenant_label if (collabora_multitenant_label) else '' }}"

View file

@ -3,6 +3,8 @@ version: '3'
services: services:
collabora: collabora:
image: collabora/code image: collabora/code
container_name: collabora{{ collabora_multitenant_postfix }}
hostname: collabora{{ collabora_multitenant_postfix }}
restart: unless-stopped restart: unless-stopped
environment: environment:
- extra_params - extra_params
@ -16,11 +18,11 @@ services:
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.docker.network=traefik_public" - "traefik.docker.network=traefik_public"
- "traefik.http.routers.collabora.rule=Host(`{{ collabora_virtual_host }}`)" - "traefik.http.routers.collabora{{ collabora_multitenant_postfix }}.rule=Host(`{{ collabora_virtual_host }}`)"
- "traefik.port=9980" - "traefik.port={{ collabora_exposed_port }}"
- "traefik.http.routers.collabora.entrypoints=websecure" - "traefik.http.routers.collabora{{ collabora_multitenant_postfix }}.entrypoints=websecure"
- "traefik.http.routers.collabora.tls=true" - "traefik.http.routers.collabora{{ collabora_multitenant_postfix }}.tls=true"
- "traefik.http.routers.collabora.tls.certresolver=defaultresolver" - "traefik.http.routers.collabora{{ collabora_multitenant_postfix }}.tls.certresolver=defaultresolver"
networks: networks:
public: public:
cap_add: cap_add: