2024-07-22 23:00:11 +02:00

250 lines
8.1 KiB
YAML

---
- name: Install dependencies
yum:
name:
- java-17-openjdk-devel
- git
- nodejs # needed to build meet
- libXScrnSaver # needed for jigasi
- python3 # needed for confmapper
- make
- lua-ldap # All the lua libs are for prosody
- lua-cyrussasl
- lua-cjson
- lua-basexx
- lua-luaossl
- lua-inspect
- libjwt
tags: jitsi
# If you use an Let's Encrypt cert, it might not be there yet. In this case, create a link
# to the default prosody cert so the service can be started. The cert will be obtained after that and
# will override the links
- name: Link cert to the default one
file: path={{ jitsi_cert_path }} src=/etc/prosody/certs/localhost.crt state=link
when: not jitsi_cert_file.stat.exists
tags: jitsi
- name: Link key to the default one
file: path={{ jitsi_key_path }} src=/etc/prosody/certs/localhost.key state=link
when: not jitsi_key_file.stat.exists
tags: jitsi
- name: Install prosody modules
synchronize:
src: prosody/modules/
dest: "{{ jitsi_root_dir }}/prosody/modules/"
recursive: true
notify: restart prosody
tags: jitsi
- name: Install bypass_pwd module for prosody
template: src=mod_jibri_bypass_pwd.lua.j2 dest={{ jitsi_root_dir }}/prosody/modules/mod_jibri_bypass_pwd.lua
notify: restart prosody
tags: jitsi
- when: jitsi_jicofo_install_mode != 'none'
block:
- name: Download Jitsi jicofo archive
get_url:
url: "{{ jitsi_jicofo_archive_url }}"
dest: "{{ jitsi_root_dir }}/tmp"
checksum: sha256:{{ jitsi_jicofo_archive_sha256 }}
become_user: "{{ jitsi_user }}"
- name: Extract Jitsi Jicofo archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jicofo-stable-jitsi-meet_{{ jitsi_version }}.tar.gz"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: true
become_user: "{{ jitsi_user }}"
- name: Build jicofo
command: /opt/maven/apache-maven/bin/mvn package -DskipTests -Dassembly.skipAssembly=false
args:
chdir: "{{ jitsi_root_dir }}/tmp/jicofo-stable-jitsi-meet_{{ jitsi_version }}"
environment:
JAVA_HOME: /usr/lib/jvm/java-17
become_user: "{{ jitsi_user }}"
- name: Install jicofo jar
copy:
src: "{{ jitsi_root_dir }}/tmp/jicofo-stable-jitsi-meet_{{ jitsi_version }}/jicofo/target/jicofo-1.1-SNAPSHOT-jar-with-dependencies.jar"
dest: "{{ jitsi_root_dir }}/jicofo/jicofo.jar"
remote_src: true
- name: Install jicofo startup script
copy:
src: "{{ jitsi_root_dir }}/tmp/jicofo-stable-jitsi-meet_{{ jitsi_version }}/resources/jicofo.sh"
dest: "{{ jitsi_root_dir }}/jicofo/jicofo.sh"
mode: 0755
owner: root
group: root
remote_src: true
- name: Write version
copy: content={{ jitsi_version }} dest={{ jitsi_root_dir }}/meta/ansible_jicofo_version
tags: jitsi
- when: jitsi_jigasi_install_mode != 'none'
block:
- name: Download Jitsi jigasi archive
get_url:
url: "{{ jitsi_jigasi_archive_url }}"
dest: "{{ jitsi_root_dir }}/tmp"
become_user: "{{ jitsi_user }}"
- name: Extract Jitsi Jigasi archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jigasi-master.tar.gz"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: true
become_user: "{{ jitsi_user }}"
- name: Build jigasi
command: /opt/maven/apache-maven/bin/mvn package -DskipTests -Dassembly.skipAssembly=false
args:
chdir: "{{ jitsi_root_dir }}/tmp/jigasi-master"
environment:
JAVA_HOME: /usr/lib/jvm/java-17
become_user: "{{ jitsi_user }}"
- name: Extract jigasi archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jigasi-master/target/jigasi-linux-x64-1.1-SNAPSHOT.zip"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: true
- name: Move jigasi to its final directory
synchronize:
src: "{{ jitsi_root_dir }}/tmp/jigasi-linux-x64-1.1-SNAPSHOT/"
dest: "{{ jitsi_root_dir }}/jigasi/"
recursive: true
delete: true
compress: false
delegate_to: "{{ inventory_hostname }}"
notify: restart jitsi-jigasi
- name: Write version
copy: content={{ jitsi_version }} dest={{ jitsi_root_dir }}/meta/ansible_jigasi_version
tags: jitsi
- when: jitsi_excalidraw_install_mode != 'none'
block:
- name: Download Excalidraw backend
get_url:
url: "{{ jitsi_excalidraw_archive_url }}"
dest: "{{ jitsi_root_dir }}/tmp"
checksum: sha256:{{ jitsi_excalidraw_archive_sha256 }}
become_user: "{{ jitsi_user }}"
- name: Extract Excalidraw archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/excalidraw-backend-{{ jitsi_excalidraw_version }}.tar.gz"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: true
become_user: "{{ jitsi_user }}"
- name: Install node dependencies
npm: path={{ jitsi_root_dir }}/tmp/excalidraw-backend-{{ jitsi_excalidraw_version }}
become_user: "{{ jitsi_user }}"
- name: Install Excalidraw backend
synchronize:
src: "{{ jitsi_root_dir }}/tmp/excalidraw-backend-{{ jitsi_excalidraw_version }}/"
dest: "{{ jitsi_root_dir }}/excalidraw/"
recursive: true
delete: true
compress: false
delegate_to: "{{ inventory_hostname }}"
- name: Write installed version
copy: content={{ jitsi_excalidraw_version }} dest={{ jitsi_root_dir }}/meta/ansible_excalidraw_version
tags: jitsi
- name: Deploy systemd unit
template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item }}.service
loop:
- jitsi-jicofo
- jitsi-jigasi
- jitsi-confmapper
- jitsi-excalidraw
register: jitsi_units
notify:
- restart jitsi-jicofo
- restart jitsi-jigasi
- restart jitsi-confmapper
- restart jitsi-excalidraw
tags: jitsi
- name: Reload systemd
systemd: daemon_reload=True
when: jitsi_units.results | selectattr('changed', 'equalto', True) | list | length > 0
tags: jitsi
- when: jitsi_meet_install_mode != 'none'
block:
- name: Download Jitsi Meet archive
get_url:
url: "{{ jitsi_meet_archive_url }}"
dest: "{{ jitsi_root_dir }}/tmp"
checksum: sha256:{{ jitsi_meet_archive_sha256 }}
become_user: "{{ jitsi_user }}"
- name: Extract Jitsi Meet archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jitsi-meet-stable-jitsi-meet_{{ jitsi_version }}.tar.gz"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: true
become_user: "{{ jitsi_user }}"
- name: Clear node_modules cache
file: path={{ jitsi_root_dir }}/tmp/jitsi-meet-stable-jitsi-meet_{{ jitsi_version }}/node_modules state=absent
- name: Install jitsi meet node dependencies
npm: path={{ jitsi_root_dir }}/tmp/jitsi-meet-stable-jitsi-meet_{{ jitsi_version }}
become_user: "{{ jitsi_user }}"
- name: Build jitsi meet
command: make
args:
chdir: "{{ jitsi_root_dir }}/tmp/jitsi-meet-stable-jitsi-meet_{{ jitsi_version }}"
become_user: "{{ jitsi_user }}"
- name: Deploy new jitsi meet version
shell: |
rm -rf {{ jitsi_root_dir }}/meet/*
mkdir -p {{ jitsi_root_dir }}/meet/css
cp -r *.js *.html resources/*.txt connection_optimization favicon.ico fonts images libs static sounds LICENSE lang {{ jitsi_root_dir }}/meet/
cp css/all.css {{ jitsi_root_dir }}/meet/css/
args:
chdir: "{{ jitsi_root_dir }}/tmp/jitsi-meet-stable-jitsi-meet_{{ jitsi_version }}"
- name: Write installed version
copy: content={{ jitsi_version }} dest={{ jitsi_root_dir }}/meta/ansible_meet_version
tags: jitsi
- name: Update languages
include_tasks: update_lang.yml
loop: "{{ jitsi_meet_custom_lang.keys() | list }}"
tags: jitsi
- name: Install dehydrated hook
template: src=dehydrated_hook.sh.j2 dest=/etc/dehydrated/hooks_deploy_cert.d/jitsi.sh mode=755
tags: jitsi
- name: Install the conference mapping daemon
get_url:
url: https://raw.githubusercontent.com/gronke/jitsi-conferencemapper-api/master/daemon.py
dest: "{{ jitsi_root_dir }}/confmapper/daemon.py"
mode: 0755
notify: restart jitsi-confmapper
tags: jitsi