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.
103 lines
3.6 KiB
103 lines
3.6 KiB
5 years ago
|
---
|
||
|
|
||
|
#
|
||
|
# Tasks related to setting up jitsi-jvb
|
||
|
#
|
||
|
|
||
|
- name: Ensure Matrix jitsi-jvb path exists
|
||
2 years ago
|
ansible.builtin.file:
|
||
5 years ago
|
path: "{{ item.path }}"
|
||
|
state: directory
|
||
|
mode: 0777
|
||
|
owner: "{{ matrix_user_username }}"
|
||
5 years ago
|
group: "{{ matrix_user_groupname }}"
|
||
5 years ago
|
with_items:
|
||
3 years ago
|
- {path: "{{ matrix_jitsi_jvb_base_path }}", when: true}
|
||
|
- {path: "{{ matrix_jitsi_jvb_config_path }}", when: true}
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool and item.when
|
||
5 years ago
|
|
||
|
- name: Ensure jitsi-jvb Docker image is pulled
|
||
2 years ago
|
community.docker.docker_image:
|
||
5 years ago
|
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 }}"
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
3 years ago
|
register: result
|
||
|
retries: "{{ matrix_container_retries_count }}"
|
||
|
delay: "{{ matrix_container_retries_delay }}"
|
||
|
until: result is not failed
|
||
5 years ago
|
|
||
5 years ago
|
- name: Ensure jitsi-jvb configuration files created
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jvb/{{ item }}.j2"
|
||
|
dest: "{{ matrix_jitsi_jvb_config_path }}/{{ item }}"
|
||
3 years ago
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_groupname }}"
|
||
5 years ago
|
mode: 0644
|
||
|
with_items:
|
||
4 years ago
|
- custom-sip-communicator.properties
|
||
5 years ago
|
- logging.properties
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
5 years ago
|
|
||
5 years ago
|
- name: Ensure jitsi-jvb environment variables file created
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jvb/env.j2"
|
||
|
dest: "{{ matrix_jitsi_jvb_base_path }}/env"
|
||
3 years ago
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_groupname }}"
|
||
5 years ago
|
mode: 0640
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
5 years ago
|
|
||
5 years ago
|
- name: Ensure matrix-jitsi-jvb.service installed
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jvb/matrix-jitsi-jvb.service.j2"
|
||
5 years ago
|
dest: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||
5 years ago
|
mode: 0644
|
||
|
register: matrix_jitsi_jvb_systemd_service_result
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
5 years ago
|
|
||
|
- name: Ensure systemd reloaded after matrix-jitsi-jvb.service installation
|
||
2 years ago
|
ansible.builtin.service:
|
||
3 years ago
|
daemon_reload: true
|
||
5 years ago
|
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
|
||
2 years ago
|
ansible.builtin.stat:
|
||
5 years ago
|
path: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||
5 years ago
|
register: matrix_jitsi_jvb_service_stat
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool"
|
||
5 years ago
|
|
||
|
- name: Ensure matrix-jitsi-jvb is stopped
|
||
2 years ago
|
ansible.builtin.service:
|
||
5 years ago
|
name: matrix-jitsi-jvb
|
||
|
state: stopped
|
||
3 years ago
|
enabled: false
|
||
|
daemon_reload: true
|
||
5 years ago
|
register: stopping_result
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure matrix-jitsi-jvb.service doesn't exist
|
||
2 years ago
|
ansible.builtin.file:
|
||
5 years ago
|
path: "{{ matrix_systemd_path }}/matrix-jitsi-jvb.service"
|
||
5 years ago
|
state: absent
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure systemd reloaded after matrix-jitsi-jvb.service removal
|
||
2 years ago
|
ansible.builtin.service:
|
||
3 years ago
|
daemon_reload: true
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jvb_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure Matrix jitsi-jvb paths doesn't exist
|
||
2 years ago
|
ansible.builtin.file:
|
||
5 years ago
|
path: "{{ matrix_jitsi_jvb_base_path }}"
|
||
|
state: absent
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool"
|
||
5 years ago
|
|
||
4 years ago
|
# Intentionally not removing the Docker image when uninstalling.
|
||
|
# We can't be sure it had been pulled by us in the first place.
|