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

44 lines
1.5 KiB
YAML
Raw Normal View History

2019-09-25 19:07:13 +00:00
---
- name: Start Bazarr
2022-08-28 15:17:33 +00:00
block:
- name: Create Bazarr Directories
2023-04-15 13:11:49 +00:00
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ bazarr_data_directory }}"
2022-08-28 15:17:33 +00:00
- name: Bazarr
2023-04-15 13:11:49 +00:00
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
image: linuxserver/bazarr
pull: true
volumes:
- "{{ bazarr_tv_directory }}:/tv:rw"
- "{{ bazarr_movies_directory }}:/movies:rw"
- "{{ bazarr_data_directory }}:/config:rw"
ports:
- "{{ bazarr_port }}:6767"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ bazarr_user_id }}"
PGID: "{{ bazarr_group_id }}"
restart_policy: unless-stopped
memory: "{{ bazarr_memory }}"
labels:
traefik.enable: "{{ bazarr_available_externally | string }}"
traefik.http.routers.bazarr.rule: "Host(`{{ bazarr_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.bazarr.tls.certresolver: "letsencrypt"
traefik.http.routers.bazarr.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.bazarr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.bazarr.loadbalancer.server.port: "6767"
2022-08-28 15:17:33 +00:00
when: bazarr_enabled is true
- name: Stop Bazarr
block:
- name: Stop Bazarr
2023-04-15 13:11:49 +00:00
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
state: absent
when: bazarr_enabled is false