Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

206 lines
6.0 KiB

---
- name: Install dependencies
yum:
name:
- java-1.8.0-openjdk
- maven
- git
- nodejs
- libXScrnSaver
tags: jitsi
- name: Check if cert file exist
stat: path={{ jitsi_cert_path }}
register: jitsi_cert_file
tags: jitsi
- 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: Check if key file exist
stat: path={{ jitsi_key_path }}
register: jitsi_key_file
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
- when: jitsi_videobridge_install_mode != 'none'
tags: jitsi
block:
- name: Download videobridge
get_url:
url: "{{ jitsi_videobridge_archive_url }}"
dest: "{{ jitsi_root_dir }}/tmp"
checksum: sha1:{{ jitsi_videobridge_archive_sha1 }}
- name: Extract videobridge
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jitsi-videobridge-linux-x64-{{ jitsi_videobridge_version }}.zip"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: True
- name: Move videobridge to its final location
synchronize:
src: "{{ jitsi_root_dir }}/tmp/jitsi-videobridge-linux-x64-{{ jitsi_videobridge_version }}/"
dest: "{{ jitsi_root_dir }}/videobridge/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
- name: Write installed version
copy: content={{ jitsi_videobridge_version }} dest={{ jitsi_root_dir }}/meta/ansible_videobridge_version
tags: jitsi
- name: Configure maven for {{ jitsi_user }}
template: src=maven.xml.j2 dest={{ jitsi_root_dir }}/.m2/settings.xml
tags: jitsi
- name: Clone jicofo repo
git:
repo: "{{ jitsi_jicofo_git_url }}"
dest: "{{ jitsi_root_dir }}/tmp/jicofo"
force: True
become_user: "{{ jitsi_user }}"
register: jitsi_jicofo_git
tags: jitsi
- name: Check if jicofo is built
stat: path={{ jitsi_root_dir }}/jicofo/jicofo.sh
register: jitsi_jicofo_script
tags: jitsi
- name: Install or update jicofo
block:
- name: Build jicofo
command: mvn package -DskipTests -Dassembly.skipAssembly=false
args:
chdir: "{{ jitsi_root_dir }}/tmp/jicofo"
become_user: "{{ jitsi_user }}"
- name: Extract jicofo archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jicofo/target/jicofo-1.1-SNAPSHOT-archive.zip"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: True
- name: Move jicofo to its final directory
synchronize:
src: "{{ jitsi_root_dir }}/tmp/jicofo-1.1-SNAPSHOT/"
dest: "{{ jitsi_root_dir }}/jicofo/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
notify: restart jitsi-jicofo
when: jitsi_jicofo_git.changed or not jitsi_jicofo_script.stat.exists
tags: jitsi
- name: Clone jigasi repo
git:
repo: "{{ jitsi_jigasi_git_url }}"
dest: "{{ jitsi_root_dir }}/tmp/jigasi"
force: True
become_user: "{{ jitsi_user }}"
register: jitsi_jigasi_git
tags: jitsi
- name: Check if jigasi is built
stat: path={{ jitsi_root_dir }}/jigasi/jigasi.sh
register: jitsi_jigasi_script
tags: jitsi
- name: Install or update jigasi
block:
- name: Build jigasi
command: mvn package -DskipTests -Dassembly.skipAssembly=false
args:
chdir: "{{ jitsi_root_dir }}/tmp/jigasi"
become_user: "{{ jitsi_user }}"
- name: Extract jigasi archive
unarchive:
src: "{{ jitsi_root_dir }}/tmp/jigasi/target/jigasi-linux-x64-1.1-SNAPSHOT.zip"
dest: "{{ jitsi_root_dir }}/tmp/"
remote_src: True
- name: Link libunix-java lib
file: src=libunix-0.5.1.so dest={{ jitsi_root_dir }}/tmp/jigasi-linux-x64-1.1-SNAPSHOT/lib/libunix-java.so state=link
- 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
delegate_to: "{{ inventory_hostname }}"
notify: restart jitsi-jigasi
when: jitsi_jigasi_git.changed or not jitsi_jigasi_script.stat.exists
tags: jitsi
- name: Deploy systemd unit
template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item }}.service
loop:
- jitsi-videobridge
- jitsi-jicofo
- jitsi-jigasi
register: jitsi_units
notify:
- restart jitsi-videobridge
- restart jitsi-jicofo
- restart jitsi-jigasi
tags: jitsi
- name: Reload systemd
systemd: daemon_reload=True
when: jitsi_units.results | selectattr('changed', 'equalto', True) | list | length > 0
tags: jitsi
- name: Clone jitsi meet
git:
repo: "{{ jitsi_meet_git_url }}"
dest: "{{ jitsi_root_dir }}/tmp/meet"
force: True
register: jitsi_meet_git
become_user: "{{ jitsi_user }}"
tags: jitsi
- when: jitsi_meet_git.changed
tags: jitsi
block:
- name: Install jitsi meet node dependencies
npm: path={{ jitsi_root_dir }}/tmp/meet
become_user: "{{ jitsi_user }}"
- name: Build jitsi meet
command: make
args:
chdir: "{{ jitsi_root_dir }}/tmp/meet"
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 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/meet"
- name: Install prosody plugins
synchronize:
src: "{{ jitsi_root_dir }}/tmp/meet/resources/prosody-plugins/"
dest: "{{ jitsi_root_dir }}/prosody/"
recursive: True
delete: True
delegate_to: "{{ inventory_hostname }}"
notify: reload prosody
- name: Install dehydrated hook
template: src=dehydrated_hook.sh.j2 dest=/etc/dehydrated/hooks_deploy_cert.d/jitsi.sh mode=755
tags: jitsi