47 lines
1.5 KiB
YAML

---
# roles/custom/matrix-livekit-server/tasks/install.yml
# Ensure Required Directories Exist
- name: Ensure matrix-livekit-server paths exist
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0750
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items:
- path: "{{ matrix_livekit_server_base_path }}"
# Ensure Configuration Files are in Place
- name: Ensure LiveKit livekit.yaml is in place
ansible.builtin.template:
src: "{{ role_path }}/templates/livekit.yaml.j2"
dest: "{{ matrix_livekit_server_base_path }}/livekit.yaml"
mode: 0640
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
- name: Ensure LiveKit labels file is in place
ansible.builtin.template:
src: "{{ role_path }}/templates/labels.j2"
dest: "{{ matrix_livekit_server_base_path }}/labels"
mode: 0640
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
# Ensure Docker Images are Pulled
- name: Ensure livekit Docker image is pulled
community.docker.docker_image:
name: "{{ matrix_livekit_server_image }}"
source: pull
register: livekit_image_result
retries: 3
delay: 10
until: livekit_image_result is not failed
# Systemd Services for LiveKit
- name: Ensure livekit systemd service is installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/matrix-livekit-server.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-livekit-server.service"
mode: 0644