149 lines
5.3 KiB
YAML
149 lines
5.3 KiB
YAML
---
|
|
- name: Verify jitsi role
|
|
hosts: localhost
|
|
gather_facts: false
|
|
vars:
|
|
jitsi_data_dir: /tmp/sovereign_test/jitsi
|
|
jitsi_domain: meet.test.example.com
|
|
tenant_name: Test Corp
|
|
base_domain: test.example.com
|
|
|
|
tasks:
|
|
- name: Check jitsi data directory exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi"
|
|
register: data_dir_stat
|
|
|
|
- name: Assert jitsi data directory is present
|
|
ansible.builtin.assert:
|
|
that: data_dir_stat.stat.isdir
|
|
fail_msg: "Data directory /tmp/sovereign_test/jitsi was not created"
|
|
|
|
- name: Check web subdirectory exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/web"
|
|
register: web_dir_stat
|
|
|
|
- name: Assert web subdirectory is present
|
|
ansible.builtin.assert:
|
|
that: web_dir_stat.stat.isdir
|
|
fail_msg: "Web directory /tmp/sovereign_test/jitsi/web was not created"
|
|
|
|
- name: Check prosody subdirectory exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/prosody"
|
|
register: prosody_dir_stat
|
|
|
|
- name: Assert prosody subdirectory is present
|
|
ansible.builtin.assert:
|
|
that: prosody_dir_stat.stat.isdir
|
|
fail_msg: "Prosody directory /tmp/sovereign_test/jitsi/prosody was not created"
|
|
|
|
- name: Check jicofo subdirectory exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/jicofo"
|
|
register: jicofo_dir_stat
|
|
|
|
- name: Assert jicofo subdirectory is present
|
|
ansible.builtin.assert:
|
|
that: jicofo_dir_stat.stat.isdir
|
|
fail_msg: "Jicofo directory /tmp/sovereign_test/jitsi/jicofo was not created"
|
|
|
|
- name: Check jvb subdirectory exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/jvb"
|
|
register: jvb_dir_stat
|
|
|
|
- name: Assert jvb subdirectory is present
|
|
ansible.builtin.assert:
|
|
that: jvb_dir_stat.stat.isdir
|
|
fail_msg: "JVB directory /tmp/sovereign_test/jitsi/jvb was not created"
|
|
|
|
- name: Check custom-interface-config.js exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/web/custom-interface-config.js"
|
|
register: interface_config_stat
|
|
|
|
- name: Assert custom-interface-config.js was rendered
|
|
ansible.builtin.assert:
|
|
that: interface_config_stat.stat.exists
|
|
fail_msg: "web/custom-interface-config.js was not rendered for jitsi"
|
|
|
|
- name: Read custom-interface-config.js
|
|
ansible.builtin.slurp:
|
|
src: "/tmp/sovereign_test/jitsi/web/custom-interface-config.js"
|
|
register: interface_config_raw
|
|
|
|
- name: Set interface config content fact
|
|
ansible.builtin.set_fact:
|
|
interface_config: "{{ interface_config_raw.content | b64decode }}"
|
|
|
|
- name: Assert interface config contains tenant name
|
|
ansible.builtin.assert:
|
|
that: "'Test Corp' in interface_config"
|
|
fail_msg: "custom-interface-config.js does not contain tenant name 'Test Corp'"
|
|
|
|
- name: Assert interface config contains base domain
|
|
ansible.builtin.assert:
|
|
that: "'test.example.com' in interface_config"
|
|
fail_msg: "custom-interface-config.js does not contain base_domain test.example.com"
|
|
|
|
- name: Check docker-compose.yml exists
|
|
ansible.builtin.stat:
|
|
path: "/tmp/sovereign_test/jitsi/docker-compose.yml"
|
|
register: compose_stat
|
|
|
|
- name: Assert docker-compose.yml was rendered
|
|
ansible.builtin.assert:
|
|
that: compose_stat.stat.exists
|
|
fail_msg: "docker-compose.yml was not rendered for jitsi"
|
|
|
|
- name: Read docker-compose.yml
|
|
ansible.builtin.slurp:
|
|
src: "/tmp/sovereign_test/jitsi/docker-compose.yml"
|
|
register: compose_raw
|
|
|
|
- name: Set compose content fact
|
|
ansible.builtin.set_fact:
|
|
compose: "{{ compose_raw.content | b64decode }}"
|
|
|
|
- name: Assert jitsi web image is present
|
|
ansible.builtin.assert:
|
|
that: "'jitsi/web' in compose"
|
|
fail_msg: "jitsi/web image not found in docker-compose.yml"
|
|
|
|
- name: Assert jitsi prosody image is present
|
|
ansible.builtin.assert:
|
|
that: "'jitsi/prosody' in compose"
|
|
fail_msg: "jitsi/prosody image not found in docker-compose.yml"
|
|
|
|
- name: Assert jitsi jicofo image is present
|
|
ansible.builtin.assert:
|
|
that: "'jitsi/jicofo' in compose"
|
|
fail_msg: "jitsi/jicofo image not found in docker-compose.yml"
|
|
|
|
- name: Assert jitsi jvb image is present
|
|
ansible.builtin.assert:
|
|
that: "'jitsi/jvb' in compose"
|
|
fail_msg: "jitsi/jvb image not found in docker-compose.yml"
|
|
|
|
- name: Assert jitsi domain traefik rule is present
|
|
ansible.builtin.assert:
|
|
that: "'Host(`meet.test.example.com`)' in compose"
|
|
fail_msg: "Traefik rule for meet.test.example.com not found in docker-compose.yml"
|
|
|
|
- name: Assert JITSI_WATERMARKLINK env var is present
|
|
ansible.builtin.assert:
|
|
that: "'JITSI_WATERMARKLINK' in compose"
|
|
fail_msg: "JITSI_WATERMARKLINK not found in docker-compose.yml"
|
|
|
|
- name: Assert GELF logging address is present
|
|
ansible.builtin.assert:
|
|
that: "'udp://127.0.0.1:12201' in compose"
|
|
fail_msg: "GELF logging address udp://127.0.0.1:12201 not found in docker-compose.yml"
|
|
|
|
- name: Assert sovereign network is external
|
|
ansible.builtin.assert:
|
|
that: "'external: true' in compose"
|
|
fail_msg: "external: true not found in docker-compose.yml networks section"
|