Move roles/matrix* to roles/custom/matrix*
This paves the way for installing other roles into `roles/galaxy` using `ansible-galaxy`, similar to how it's done in: - https://github.com/spantaleev/gitea-docker-ansible-deploy - https://github.com/spantaleev/nextcloud-docker-ansible-deploy In the near future, we'll be removing a lot of the shared role code from here and using upstream roles for it. Some of the core `matrix-*` roles have already been extracted out into other reusable roles: - https://github.com/devture/com.devture.ansible.role.postgres - https://github.com/devture/com.devture.ansible.role.systemd_docker_base - https://github.com/devture/com.devture.ansible.role.timesync - https://github.com/devture/com.devture.ansible.role.vars_preserver - https://github.com/devture/com.devture.ansible.role.playbook_runtime_messages - https://github.com/devture/com.devture.ansible.role.playbook_help We just need to migrate to those.
This commit is contained in:
10
roles/custom/matrix-jitsi/tasks/init.yml
Normal file
10
roles/custom/matrix-jitsi/tasks/init.yml
Normal file
@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
matrix_systemd_services_list: "{{ matrix_systemd_services_list + ['matrix-jitsi-web.service', 'matrix-jitsi-prosody.service', 'matrix-jitsi-jicofo.service', 'matrix-jitsi-jvb.service'] }}"
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Fail if on an unsupported architecture
|
||||
ansible.builtin.fail:
|
||||
msg: "Jitsi only supports the amd64 architecture right now. See https://github.com/jitsi/docker-jitsi-meet/issues/1069 and https://github.com/jitsi/docker-jitsi-meet/issues/1214"
|
||||
when: matrix_jitsi_enabled | bool and matrix_architecture not in ['amd64', 'arm64']
|
41
roles/custom/matrix-jitsi/tasks/main.yml
Normal file
41
roles/custom/matrix-jitsi/tasks/main.yml
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/init.yml"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||
when: "run_setup | bool and matrix_jitsi_enabled | bool"
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_jitsi_base.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_jitsi_web.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_jitsi_prosody.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_jitsi_jicofo.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/tasks/setup_jitsi_jvb.yml"
|
||||
when: run_setup | bool
|
||||
tags:
|
||||
- setup-all
|
||||
- setup-jitsi
|
22
roles/custom/matrix-jitsi/tasks/setup_jitsi_base.yml
Normal file
22
roles/custom/matrix-jitsi/tasks/setup_jitsi_base.yml
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
|
||||
- ansible.builtin.import_tasks: "{{ role_path }}/../matrix-base/tasks/util/ensure_openssl_installed.yml"
|
||||
|
||||
#
|
||||
# Tasks related to setting up jitsi
|
||||
#
|
||||
|
||||
- name: Ensure Matrix jitsi base path exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0750
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_jitsi_base_path }}", when: true}
|
||||
when: matrix_jitsi_enabled | bool and item.when
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of jitsi (if it was previously enabled)
|
||||
#
|
102
roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo.yml
Normal file
102
roles/custom/matrix-jitsi/tasks/setup_jitsi_jicofo.yml
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
|
||||
#
|
||||
# Tasks related to setting up jitsi-jicofo
|
||||
#
|
||||
|
||||
- name: Ensure Matrix jitsi-jicofo path exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_jitsi_jicofo_base_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_jicofo_config_path }}", when: true}
|
||||
when: matrix_jitsi_enabled | bool and item.when
|
||||
|
||||
- name: Ensure jitsi-jicofo Docker image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_jitsi_jicofo_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_jitsi_jicofo_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_jicofo_docker_image_force_pull }}"
|
||||
when: matrix_jitsi_enabled | bool
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure jitsi-jicofo environment variables file created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jicofo/env.j2"
|
||||
dest: "{{ matrix_jitsi_jicofo_base_path }}/env"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0640
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure jitsi-jicofo configuration files created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jicofo/{{ item }}.j2"
|
||||
dest: "{{ matrix_jitsi_jicofo_config_path }}/{{ item }}"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- sip-communicator.properties
|
||||
- logging.properties
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure matrix-jitsi-jicofo.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jicofo/matrix-jitsi-jicofo.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||||
mode: 0644
|
||||
register: matrix_jitsi_jicofo_systemd_service_result
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-jicofo.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_jitsi_enabled and matrix_jitsi_jicofo_systemd_service_result.changed"
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of jitsi-jicofo (if it was previously enabled)
|
||||
#
|
||||
|
||||
- name: Check existence of matrix-jitsi-jicofo service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||||
register: matrix_jitsi_jicofo_service_stat
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-jitsi-jicofo is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-jitsi-jicofo
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jicofo_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-jitsi-jicofo.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jicofo_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-jicofo.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jicofo_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix jitsi-jicofo paths doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_jitsi_jicofo_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
# Intentionally not removing the Docker image when uninstalling.
|
||||
# We can't be sure it had been pulled by us in the first place.
|
102
roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb.yml
Normal file
102
roles/custom/matrix-jitsi/tasks/setup_jitsi_jvb.yml
Normal file
@ -0,0 +1,102 @@
|
||||
---
|
||||
|
||||
#
|
||||
# Tasks related to setting up jitsi-jvb
|
||||
#
|
||||
|
||||
- name: Ensure Matrix jitsi-jvb path exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_jitsi_jvb_base_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_jvb_config_path }}", when: true}
|
||||
when: matrix_jitsi_enabled | bool and item.when
|
||||
|
||||
- name: Ensure jitsi-jvb Docker image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_jitsi_jvb_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_jitsi_jvb_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_jvb_docker_image_force_pull }}"
|
||||
when: matrix_jitsi_enabled | bool
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure jitsi-jvb configuration files created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jvb/{{ item }}.j2"
|
||||
dest: "{{ matrix_jitsi_jvb_config_path }}/{{ item }}"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- custom-sip-communicator.properties
|
||||
- logging.properties
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure jitsi-jvb environment variables file created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jvb/env.j2"
|
||||
dest: "{{ matrix_jitsi_jvb_base_path }}/env"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0640
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure matrix-jitsi-jvb.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/jvb/matrix-jitsi-jvb.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||||
mode: 0644
|
||||
register: matrix_jitsi_jvb_systemd_service_result
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-jvb.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_jitsi_enabled and matrix_jitsi_jvb_systemd_service_result.changed"
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of jitsi-jvb (if it was previously enabled)
|
||||
#
|
||||
|
||||
- name: Check existence of matrix-jitsi-jvb service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||||
register: matrix_jitsi_jvb_service_stat
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-jitsi-jvb is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-jitsi-jvb
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-jitsi-jvb.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-jvb.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix jitsi-jvb paths doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_jitsi_jvb_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
# Intentionally not removing the Docker image when uninstalling.
|
||||
# We can't be sure it had been pulled by us in the first place.
|
99
roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody.yml
Normal file
99
roles/custom/matrix-jitsi/tasks/setup_jitsi_prosody.yml
Normal file
@ -0,0 +1,99 @@
|
||||
---
|
||||
|
||||
#
|
||||
# Tasks related to setting up jitsi-prosody
|
||||
#
|
||||
|
||||
- name: Ensure Matrix jitsi-prosody environment exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_jitsi_prosody_base_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_prosody_config_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_prosody_plugins_path }}", when: true}
|
||||
when: matrix_jitsi_enabled | bool and item.when
|
||||
|
||||
- name: Ensure jitsi-prosody Docker image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_jitsi_prosody_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_jitsi_prosody_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_prosody_docker_image_force_pull }}"
|
||||
when: matrix_jitsi_enabled | bool
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure jitsi-prosody environment variables file is created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/prosody/env.j2"
|
||||
dest: "{{ matrix_jitsi_prosody_base_path }}/env"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0640
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure matrix-jitsi-prosody.service file is installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/prosody/matrix-jitsi-prosody.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-jitsi-prosody.service"
|
||||
mode: 0644
|
||||
register: matrix_jitsi_prosody_systemd_service_result
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure systemd service is reloaded after matrix-jitsi-prosody.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_jitsi_enabled and matrix_jitsi_prosody_systemd_service_result.changed"
|
||||
|
||||
- name: Ensure authentication is properly configured
|
||||
ansible.builtin.include_tasks:
|
||||
file: "{{ role_path }}/tasks/util/setup_jitsi_auth.yml"
|
||||
when:
|
||||
- matrix_jitsi_enabled | bool
|
||||
- matrix_jitsi_enable_auth | bool
|
||||
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of jitsi-prosody (if it was previously enabled)
|
||||
#
|
||||
|
||||
- name: Ensure matrix-jitsi-prosody.service file exists
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-prosody.service"
|
||||
register: matrix_jitsi_prosody_service_stat
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-jitsi-prosody is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-jitsi-prosody
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_prosody_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-jitsi-prosody.service file doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-prosody.service"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_prosody_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd is reloaded after matrix-jitsi-prosody.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_prosody_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix jitsi-prosody paths doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_jitsi_prosody_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
# Intentionally not removing the Docker image when uninstalling.
|
||||
# We can't be sure it had been pulled by us in the first place.
|
104
roles/custom/matrix-jitsi/tasks/setup_jitsi_web.yml
Normal file
104
roles/custom/matrix-jitsi/tasks/setup_jitsi_web.yml
Normal file
@ -0,0 +1,104 @@
|
||||
---
|
||||
|
||||
#
|
||||
# Tasks related to setting up jitsi-web
|
||||
#
|
||||
|
||||
- name: Ensure Matrix jitsi-web path exists
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: directory
|
||||
mode: 0777
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
with_items:
|
||||
- {path: "{{ matrix_jitsi_web_base_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_web_config_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_web_transcripts_path }}", when: true}
|
||||
- {path: "{{ matrix_jitsi_web_crontabs_path }}", when: true}
|
||||
when: matrix_jitsi_enabled | bool and item.when
|
||||
|
||||
- name: Ensure jitsi-web Docker image is pulled
|
||||
community.docker.docker_image:
|
||||
name: "{{ matrix_jitsi_web_docker_image }}"
|
||||
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||||
force_source: "{{ matrix_jitsi_web_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
|
||||
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_jitsi_web_docker_image_force_pull }}"
|
||||
when: matrix_jitsi_enabled | bool
|
||||
register: result
|
||||
retries: "{{ matrix_container_retries_count }}"
|
||||
delay: "{{ matrix_container_retries_delay }}"
|
||||
until: result is not failed
|
||||
|
||||
- name: Ensure jitsi-web environment variables file created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/web/env.j2"
|
||||
dest: "{{ matrix_jitsi_web_base_path }}/env"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0640
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure jitsi-web configuration files created
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/web/{{ item }}.j2"
|
||||
dest: "{{ matrix_jitsi_web_config_path }}/{{ item }}"
|
||||
owner: "{{ matrix_user_username }}"
|
||||
group: "{{ matrix_user_groupname }}"
|
||||
mode: 0644
|
||||
with_items:
|
||||
- custom-config.js
|
||||
- custom-interface_config.js
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure matrix-jitsi-web.service installed
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/web/matrix-jitsi-web.service.j2"
|
||||
dest: "{{ matrix_systemd_path }}/matrix-jitsi-web.service"
|
||||
mode: 0644
|
||||
register: matrix_jitsi_web_systemd_service_result
|
||||
when: matrix_jitsi_enabled | bool
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-web.service installation
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "matrix_jitsi_enabled and matrix_jitsi_web_systemd_service_result.changed"
|
||||
|
||||
#
|
||||
# Tasks related to getting rid of jitsi-web (if it was previously enabled)
|
||||
#
|
||||
|
||||
- name: Check existence of matrix-jitsi-web service
|
||||
ansible.builtin.stat:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-web.service"
|
||||
register: matrix_jitsi_web_service_stat
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
- name: Ensure matrix-jitsi-web is stopped
|
||||
ansible.builtin.service:
|
||||
name: matrix-jitsi-web
|
||||
state: stopped
|
||||
enabled: false
|
||||
daemon_reload: true
|
||||
register: stopping_result
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_web_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure matrix-jitsi-web.service doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_systemd_path }}/matrix-jitsi-web.service"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_web_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure systemd reloaded after matrix-jitsi-web.service removal
|
||||
ansible.builtin.service:
|
||||
daemon_reload: true
|
||||
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_web_service_stat.stat.exists"
|
||||
|
||||
- name: Ensure Matrix jitsi-web paths doesn't exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ matrix_jitsi_web_base_path }}"
|
||||
state: absent
|
||||
when: "not matrix_jitsi_enabled | bool"
|
||||
|
||||
# Intentionally not removing the Docker image when uninstalling.
|
||||
# We can't be sure it had been pulled by us in the first place.
|
41
roles/custom/matrix-jitsi/tasks/util/setup_jitsi_auth.yml
Normal file
41
roles/custom/matrix-jitsi/tasks/util/setup_jitsi_auth.yml
Normal file
@ -0,0 +1,41 @@
|
||||
---
|
||||
#
|
||||
# Start Necessary Services
|
||||
#
|
||||
|
||||
- name: Ensure matrix-jitsi-prosody container is running
|
||||
ansible.builtin.systemd:
|
||||
state: started
|
||||
name: matrix-jitsi-prosody
|
||||
register: matrix_jitsi_prosody_start_result
|
||||
|
||||
|
||||
#
|
||||
# Tasks related to configuring Jitsi internal authentication
|
||||
#
|
||||
|
||||
- name: Ensure Jitsi internal authentication users are configured
|
||||
ansible.builtin.shell: "{{ matrix_host_command_docker }} exec matrix-jitsi-prosody prosodyctl --config /config/prosody.cfg.lua register {{ item.username | quote }} meet.jitsi {{ item.password | quote }}"
|
||||
with_items: "{{ matrix_jitsi_prosody_auth_internal_accounts }}"
|
||||
when:
|
||||
- matrix_jitsi_auth_type == "internal"
|
||||
- matrix_jitsi_prosody_auth_internal_accounts|length > 0
|
||||
register: matrix_jitsi_user_configuration_result
|
||||
changed_when: matrix_jitsi_user_configuration_result.rc == 0
|
||||
|
||||
#
|
||||
# Tasks related to configuring other Jitsi authentication mechanisms
|
||||
#
|
||||
|
||||
#
|
||||
# Tasks related to cleaning after Jitsi authentication configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Stop Necessary Services
|
||||
#
|
||||
- name: Ensure matrix-jitsi-prosody container is stopped if necessary
|
||||
ansible.builtin.systemd:
|
||||
state: stopped
|
||||
name: matrix-jitsi-prosody
|
||||
when: matrix_jitsi_prosody_start_result.changed | bool
|
68
roles/custom/matrix-jitsi/tasks/validate_config.yml
Normal file
68
roles/custom/matrix-jitsi/tasks/validate_config.yml
Normal file
@ -0,0 +1,68 @@
|
||||
---
|
||||
|
||||
- name: Fail if required Jitsi settings not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
You need to define a required configuration setting (`{{ item }}`) to properly configure Jitsi.
|
||||
|
||||
If you're setting up Jitsi for the first time, you may have missed a step.
|
||||
Refer to our setup instructions (docs/configuring-playbook-jitsi.md).
|
||||
|
||||
If you had previously setup Jitsi successfully and are only now facing this error,
|
||||
it means that your installation is most likely using default passwords previously defined by the playbook.
|
||||
These defaults are insecure. Jitsi should be rebuilt with secure values.
|
||||
Refer to the "Rebuilding your Jitsi installation" section in our setup instructions (docs/configuring-playbook-jitsi.md).
|
||||
when: "vars[item] == ''"
|
||||
with_items:
|
||||
- "matrix_jitsi_jibri_xmpp_password"
|
||||
- "matrix_jitsi_jibri_recorder_password"
|
||||
- "matrix_jitsi_jicofo_auth_password"
|
||||
- "matrix_jitsi_jvb_auth_password"
|
||||
|
||||
|
||||
- name: Fail if a Jitsi internal authentication account is not defined
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
At least one Jitsi user needs to be defined in `matrix_jitsi_prosody_auth_internal_accounts` when using internal authentication.
|
||||
If you're setting up Jitsi for the first time, you may have missed a step.
|
||||
Refer to our setup instructions (docs/configuring-playbook-jitsi.md).
|
||||
when:
|
||||
- matrix_jitsi_enable_auth | bool
|
||||
- matrix_jitsi_auth_type == 'internal'
|
||||
- matrix_jitsi_prosody_auth_internal_accounts|length == 0
|
||||
|
||||
|
||||
- name: (Deprecation) Catch and report renamed settings
|
||||
ansible.builtin.fail:
|
||||
msg: >-
|
||||
Your configuration contains a variable, which now has a different name.
|
||||
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
|
||||
when: "item.old in vars"
|
||||
with_items:
|
||||
- {'old': 'matrix_jitsi_web_config_constraints_enabled', 'new': '<Now unnecessary. Constraints are always applied automatically>'}
|
||||
- {'old': 'matrix_jitsi_web_config_constraints_video_aspectRatio', 'new': '<Not applicable anymore>'}
|
||||
- {'old': 'matrix_jitsi_web_config_constraints_video_height_ideal', 'new': 'matrix_jitsi_web_config_resolution_height_ideal_and_max'}
|
||||
- {'old': 'matrix_jitsi_web_config_constraints_video_height_max', 'new': 'matrix_jitsi_web_config_resolution_height_ideal_and_max'}
|
||||
- {'old': 'matrix_jitsi_web_config_constraints_video_height_min', 'new': 'matrix_jitsi_web_config_resolution_height_min'}
|
||||
- {'old': 'matrix_jitsi_web_config_disableAudioLevels', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
|
||||
- {'old': 'matrix_jitsi_web_config_enableLayerSuspension', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
|
||||
- {'old': 'matrix_jitsi_web_config_channelLastN', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension. Example in docs/configuring-playbook-jitsi.md>'}
|
||||
- {'old': 'matrix_jitsi_web_config_testing_p2pTestMode', 'new': '<Can be set by using matrix_jitsi_web_custom_config_extension>'}
|
||||
- {'old': 'matrix_jitsi_web_config_start_with_audio_muted', 'new': '<Superseded by matrix_jitsi_web_config_start_audio_muted_after_nth_participant>'}
|
||||
- {'old': 'matrix_jitsi_web_config_start_with_video_muted', 'new': '<Superseded by matrix_jitsi_web_config_start_video_muted_after_nth_participant>'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_show_watermark_for_guests', 'new': '<Not applicable anymore>'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_invitation_powered_by', 'new': '<Not applicable anymore>'}
|
||||
- {'old': 'matrix_jisti_web_interface_config_show_deep_linking_image', 'new': 'matrix_jitsi_web_interface_config_show_deep_linking_image'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_lang_detection', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_show_jitsi_watermark', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_jitsi_watermark_link', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_show_brand_watermark', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_brand_watermark_link', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_generate_room_names_on_welcome_page', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_display_welcome_page_content', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_app_name', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_native_app_name', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_provider_name', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_show_powered_by', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_disable_transcription_subtitles', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
||||
- {'old': 'matrix_jitsi_web_interface_config_show_deep_linking_image', 'new': '<Deprecated, use matrix_jitsi_web_custom_interface_config_extension instead'}
|
Reference in New Issue
Block a user