ansible-nas/roles/pytivo/tasks/main.yml

39 lines
1.3 KiB
YAML
Raw Normal View History

2020-04-22 04:35:33 +00:00
---
2021-02-05 23:58:38 +00:00
- name: Create Pytivo Directories
2020-04-22 04:35:33 +00:00
file:
path: "{{ item }}"
state: directory
mode: 0777
with_items:
- "{{ pytivo_config_directory }}"
2021-02-05 23:58:38 +00:00
- name: Pytivo
2020-04-22 04:35:33 +00:00
docker_container:
name: pytivo
image: pinion/docker-pytivo
pull: true
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ pytivo_config_directory }}:/config:rw"
- "{{ pytivo_movies_directory }}:/movies:ro"
- "{{ pytivo_tv_directory }}:/tv:ro"
- "{{ pytivo_photos_directory }}:/photos:ro"
- "{{ pytivo_music_directory }}:/music:ro"
- "{{ pytivo_podcasts_directory }}:/podcasts:ro"
2021-02-05 23:58:38 +00:00
ports:
- "9032:9032"
- "2190:2190/udp"
2020-04-22 04:35:33 +00:00
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ pytivo_user_id }}"
PGID: "{{ pytivo_group_id }}"
restart_policy: unless-stopped
memory: 1g
labels:
traefik.enable: "{{ pytivo_available_externally | string}}"
2021-02-05 23:58:38 +00:00
traefik.http.routers.pytivo.rule: "Host(`{{ pytivo_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.pytivo.tls.certresolver: "letsencrypt"
traefik.http.routers.pytivo.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.pytivo.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
2022-05-28 17:23:03 +00:00
traefik.http.services.pytivo.loadbalancer.server.port: "9032"