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

42 lines
1.5 KiB
YAML
Raw Normal View History

2019-03-22 18:46:38 +00:00
---
2023-03-09 20:47:42 +00:00
- name: Start Jackett
block:
- name: Create Jackett Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ jackett_data_directory }}"
2019-03-22 18:46:38 +00:00
2023-03-09 20:47:42 +00:00
- name: Jackett Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ jackett_container_name }}"
image: "{{ jackett_image_name }}:{{ jackett_image_version }}"
volumes:
- "{{ jackett_data_directory }}:/config:rw"
- "/etc/localtime:/etc/localtime:ro"
- "{{ jackett_torrents_root }}:/downloads"
ports:
- "{{ jackett_port }}:9117"
env:
TZ: "{{ ansible_nas_timezone }}"
restart_policy: unless-stopped
memory: "{{ jackett_memory }}"
labels:
traefik.enable: "{{ jackett_available_externally | string }}"
traefik.http.routers.jackett.rule: "Host(`{{ jackett_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.jackett.tls.certresolver: "letsencrypt"
traefik.http.routers.jackett.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.jackett.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.jackett.loadbalancer.server.port: "9117"
when: jackett_enabled is true
- name: Stop Jackett
block:
- name: Stop Jackett
community.docker.docker_container:
name: "{{ jackett_container_name }}"
state: absent
when: jackett_enabled is false