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.7 KiB
103 lines
3.7 KiB
5 years ago
|
---
|
||
|
|
||
|
#
|
||
|
# Tasks related to setting up jitsi-jicofo
|
||
|
#
|
||
|
|
||
|
- name: Ensure Matrix jitsi-jicofo 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_jicofo_base_path }}", when: true}
|
||
|
- {path: "{{ matrix_jitsi_jicofo_config_path }}", when: true}
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool and item.when
|
||
5 years ago
|
|
||
|
- name: Ensure jitsi-jicofo Docker image is pulled
|
||
2 years ago
|
community.docker.docker_image:
|
||
5 years ago
|
name: "{{ matrix_jitsi_jicofo_docker_image }}"
|
||
|
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
|
||
|
force_source: "{{ matrix_jitsi_jicofo_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_jicofo_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
|
|
||
|
- name: Ensure jitsi-jicofo environment variables file created
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jicofo/env.j2"
|
||
|
dest: "{{ matrix_jitsi_jicofo_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 jitsi-jicofo configuration files created
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jicofo/{{ item }}.j2"
|
||
|
dest: "{{ matrix_jitsi_jicofo_config_path }}/{{ item }}"
|
||
3 years ago
|
owner: "{{ matrix_user_username }}"
|
||
|
group: "{{ matrix_user_groupname }}"
|
||
5 years ago
|
mode: 0644
|
||
|
with_items:
|
||
|
- sip-communicator.properties
|
||
|
- logging.properties
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
5 years ago
|
|
||
5 years ago
|
- name: Ensure matrix-jitsi-jicofo.service installed
|
||
2 years ago
|
ansible.builtin.template:
|
||
5 years ago
|
src: "{{ role_path }}/templates/jicofo/matrix-jitsi-jicofo.service.j2"
|
||
5 years ago
|
dest: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||
5 years ago
|
mode: 0644
|
||
|
register: matrix_jitsi_jicofo_systemd_service_result
|
||
2 years ago
|
when: matrix_jitsi_enabled | bool
|
||
5 years ago
|
|
||
|
- name: Ensure systemd reloaded after matrix-jitsi-jicofo.service installation
|
||
2 years ago
|
ansible.builtin.service:
|
||
3 years ago
|
daemon_reload: true
|
||
5 years ago
|
when: "matrix_jitsi_enabled and matrix_jitsi_jicofo_systemd_service_result.changed"
|
||
|
|
||
|
#
|
||
|
# Tasks related to getting rid of jitsi-jicofo (if it was previously enabled)
|
||
|
#
|
||
|
|
||
|
- name: Check existence of matrix-jitsi-jicofo service
|
||
2 years ago
|
ansible.builtin.stat:
|
||
5 years ago
|
path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||
5 years ago
|
register: matrix_jitsi_jicofo_service_stat
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool"
|
||
5 years ago
|
|
||
|
- name: Ensure matrix-jitsi-jicofo is stopped
|
||
2 years ago
|
ansible.builtin.service:
|
||
5 years ago
|
name: matrix-jitsi-jicofo
|
||
|
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_jicofo_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure matrix-jitsi-jicofo.service doesn't exist
|
||
2 years ago
|
ansible.builtin.file:
|
||
5 years ago
|
path: "{{ matrix_systemd_path }}/matrix-jitsi-jicofo.service"
|
||
5 years ago
|
state: absent
|
||
2 years ago
|
when: "not matrix_jitsi_enabled | bool and matrix_jitsi_jicofo_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure systemd reloaded after matrix-jitsi-jicofo.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_jicofo_service_stat.stat.exists"
|
||
5 years ago
|
|
||
|
- name: Ensure Matrix jitsi-jicofo paths doesn't exist
|
||
2 years ago
|
ansible.builtin.file:
|
||
5 years ago
|
path: "{{ matrix_jitsi_jicofo_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.
|