--- - name: Start Deluge block: - name: Create Deluge Directories file: path: "{{ item }}" state: directory with_items: - "{{ deluge_config_directory }}" - "{{ deluge_download_directory }}" - name: Deluge Docker Container docker_container: name: deluge image: linuxserver/deluge pull: true volumes: - "{{ deluge_config_directory }}:/config:rw" - "{{ deluge_download_directory }}:/root/Downloads:rw" 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 - name: Stop Deluge block: - name: Stop Deluge docker_container: name: "{{ deluge_container_name }}" state: absent when: deluge_enabled is false