ansible-nas/roles/sickchill/tasks/main.yml
2023-04-15 14:11:49 +01:00

44 lines
1.7 KiB
YAML

---
- name: Start Sickchill
block:
- name: Create Sickchill Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ sickchill_config_directory }}"
- name: Sickchill Docker Container
community.docker.docker_container:
name: "{{ sickchill_container_name }}"
image: "{{ sickchill_image_name }}:{{ sickchill_image_version }}"
pull: true
volumes:
- "{{ sickchill_config_directory }}:/config:rw"
- "{{ sickchill_downloads_directory }}:/downloads:rw"
- "{{ sickchill_tv_directory }}:/tv:rw"
ports:
- "{{ sickchill_port }}:8081"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ sickchill_user_id }}"
PGID: "{{ sickchill_group_id }}"
restart_policy: unless-stopped
memory: "{{ sickchill_memory }}"
labels:
traefik.enable: "{{ sickchill_available_externally | string }}"
traefik.http.routers.sickchill.rule: "Host(`{{ sickchill_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.sickchill.tls.certresolver: "letsencrypt"
traefik.http.routers.sickchill.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.sickchill.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.sickchill.loadbalancer.server.port: "8081"
when: sickchill_enabled is true
- name: Stop Sickchill
block:
- name: Stop Sickchill
community.docker.docker_container:
name: "{{ sickchill_container_name }}"
state: absent
when: sickchill_enabled is false