2024-11-21 18:19:36 +02:00

46 lines
1.7 KiB
YAML

---
- name: Ensure LiveKit Server paths exist
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
mode: 0750
owner: "{{ livekit_server_uid }}"
group: "{{ livekit_server_gid }}"
with_items:
- {path: "{{ livekit_server_base_path }}", when: true}
- {path: "{{ livekit_server_config_path }}", when: true}
- {path: "{{ livekit_server_container_src_files_path }}", when: "{{ livekit_server_container_image_self_build }}"}
when: "item.when | bool"
- name: Ensure LiveKit Server configuration installed
ansible.builtin.copy:
content: "{{ livekit_server_configuration | to_nice_yaml(indent=2, width=999999) }}"
dest: "{{ livekit_server_config_path }}/config.yaml"
mode: 0640
owner: "{{ livekit_server_uid }}"
group: "{{ livekit_server_gid }}"
- name: Ensure LiveKit Server labels file installed
ansible.builtin.template:
src: "{{ role_path }}/templates/labels.j2"
dest: "{{ livekit_server_base_path }}/labels"
mode: 0640
owner: "{{ livekit_server_uid }}"
group: "{{ livekit_server_gid }}"
- name: Ensure LiveKit Server container image is pulled
community.docker.docker_image:
name: "{{ livekit_server_container_image }}"
source: pull
register: livekit_image_result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
until: livekit_image_result is not failed
- name: Ensure LiveKit Server systemd service is installed
ansible.builtin.template:
src: "{{ role_path }}/templates/systemd/livekit-server.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/{{ livekit_server_identifier }}.service"
mode: 0644