ansible-nas/roles/threadfin/tasks/main.yml
2024-02-26 16:23:00 +00:00

38 lines
1.3 KiB
YAML

---
- name: Start Threadfin
block:
- name: Create Threadfin Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ threadfin_data_directory }}"
- name: Threadfin Docker Container
community.docker.docker_container:
name: "{{ threadfin_container_name }}"
image: "{{ threadfin_image_name }}:{{ threadfin_image_version }}"
pull: true
ports:
- "{{ threadfin_port }}:34400"
volumes:
- "{{ threadfin_data_directory }}:/home/threadfin/conf"
restart_policy: unless-stopped
memory: "{{ threadfin_memory }}"
labels:
homepage.group: Media
homepage.name: Threadfin
homepage.icon: xteve
homepage.href: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ threadfin_port }}"
homepage.description: IPTV bridge
homepage.widget.type: xteve
homepage.widget.url: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ threadfin_port }}"
when: threadfin_enabled is true
- name: Stop Threadfin
block:
- name: Stop Threadfin
community.docker.docker_container:
name: "{{ threadfin_container_name }}"
state: absent
when: threadfin_enabled is false