ansible-role-jitsi-docker/tasks/main.yml
Jan Beilicke b4855c6a66 Several improvements (see below); New default: Only last 3 speakers will be have active video
- Remove Jitsi runtime config in case of Ansible tag teardown
- Performance: DefautSet Jitsi Web config channelLastN using jitsi_web_channel_last_n
- Adds submodule with the source of docker-jitsi-meet, which this role is based on.
2020-05-01 23:24:17 +02:00

97 lines
2.3 KiB
YAML

---
# tasks file for jitsi
- name: Ensure jitsi Docker Compose config directory exists
file:
path: /home/{{ docker_user }}/jitsi
state: directory
owner: '{{ docker_user }}'
group: '{{ docker_user }}'
tags: config
- name: "Teardown: Remove Jitsi runtime config"
file:
path: /home/{{ docker_user }}/jitsi/conf
state: absent
tags: ['never', 'teardown']
- name: Ensure jitsi config directory exists
file:
path: /home/{{ docker_user }}/jitsi/conf
state: directory
owner: '{{ docker_user }}'
group: '{{ docker_user }}'
tags: config
- name: Provide docker-compose.yml
template:
src: templates/docker-compose.jitsi.yml.j2
dest: /home/{{ docker_user }}/jitsi/docker-compose.yml
owner: "{{ docker_user }}"
group: "{{ docker_user }}"
mode: '0644'
tags: config
- name: Output docker-compose.yml
shell: cat /home/{{ docker_user }}/jitsi/docker-compose.yml
register: output
tags: config
- debug:
var: output
- name: Provide Jitsi env vars
template:
src: templates/env.jitsi.j2
dest: /home/{{ docker_user }}/jitsi/.env
owner: "{{ docker_user }}"
group: "{{ docker_user }}"
mode: '0640'
tags: config
- name: "docker-compose: Teardown existing Jitsi service"
docker_compose:
project_src: "/home/{{ docker_user }}/jitsi/"
state: absent
tags: ['never', 'teardown']
- name: "docker-compose: Bootstrap Jitsi service"
docker_compose:
project_src: "/home/{{ docker_user }}/jitsi/"
pull: yes
register: output
- debug:
var: output
- assert:
that:
- "output.ansible_facts['web']['jitsi_web_1'].state.running"
- name: "Waiting for Jitsi container to become available"
become: false
wait_for:
host: localhost
port: "{{ jitsi_exposed_http_port }}"
- name: "Config: Set channelLastN"
lineinfile:
path: /home/{{ docker_user }}/jitsi/conf/web/config.js
regexp: '(\s*)channelLastN:\s*[^,]+,'
line: '\1channelLastN: {{jitsi_web_channel_last_n|default("-1")}},'
backrefs: yes
tags: config
- name: "Test whether Jitsi is healthy from the outside"
become: false
uri:
url: https://{{ jitsi_virtual_host }}
return_content: yes
timeout: 300
validate_certs: no
register: url_check
delegate_to: localhost
tags: health
- fail:
msg: 'Jitsi homepage is not available!'
when: "'<title>Jitsi Meet' not in url_check.content"