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

44 lines
1.5 KiB
YAML
Raw Normal View History

2021-01-28 08:16:54 +00:00
---
2022-09-07 21:37:47 +00:00
- name: Start Deluge
block:
- name: Create Deluge Directories
2023-04-15 13:11:49 +00:00
ansible.builtin.file:
2022-09-07 21:37:47 +00:00
path: "{{ item }}"
state: directory
with_items:
- "{{ deluge_config_directory }}"
- "{{ deluge_download_directory }}"
2021-01-28 08:16:54 +00:00
2022-09-07 21:37:47 +00:00
- name: Deluge Docker Container
2023-04-15 13:11:49 +00:00
community.docker.docker_container:
2022-09-07 21:37:47 +00:00
name: deluge
image: linuxserver/deluge
pull: true
volumes:
- "{{ deluge_config_directory }}:/config:rw"
2023-10-24 20:49:57 +00:00
- "{{ deluge_download_directory }}:/downloads:rw"
2022-09-07 21:37:47 +00:00
ports:
- "{{ deluge_port }}:8112"
env:
TZ: "{{ deluge_timezone }}"
PUID: "{{ deluge_user_id }}"
PGID: "{{ deluge_group_id }}"
restart_policy: unless-stopped
memory: "{{ deluge_memory }}"
labels:
traefik.enable: "{{ deluge_available_externally | string }}"
traefik.http.routers.deluge.rule: "Host(`{{ deluge_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.deluge.tls.certresolver: "letsencrypt"
traefik.http.routers.deluge.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.deluge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.deluge.loadbalancer.server.port: "8112"
when: deluge_enabled is true
2022-09-07 21:37:47 +00:00
- name: Stop Deluge
block:
- name: Stop Deluge
2023-04-15 13:11:49 +00:00
community.docker.docker_container:
2022-09-07 21:37:47 +00:00
name: "{{ deluge_container_name }}"
state: absent
when: deluge_enabled is false