2018-04-10 21:57:28 +00:00
|
|
|
---
|
2023-03-10 15:40:33 +00:00
|
|
|
- name: Start Radarr
|
|
|
|
block:
|
|
|
|
- name: Create Radarr Directories
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "{{ radarr_data_directory }}"
|
2018-04-10 21:57:28 +00:00
|
|
|
|
2024-02-26 16:23:00 +00:00
|
|
|
- name: Radarr Docker Container
|
2023-03-10 15:40:33 +00:00
|
|
|
community.docker.docker_container:
|
|
|
|
name: "{{ radarr_container_name }}"
|
|
|
|
image: "{{ radarr_image_name }}:{{ radarr_image_version }}"
|
|
|
|
pull: true
|
|
|
|
volumes:
|
|
|
|
- "{{ radarr_movies_directory }}:/movies:rw"
|
|
|
|
- "{{ radarr_download_directory }}:/downloads:rw"
|
|
|
|
- "{{ radarr_data_directory }}:/config:rw"
|
|
|
|
ports:
|
|
|
|
- "{{ radarr_port }}:7878"
|
|
|
|
env:
|
|
|
|
TZ: "{{ ansible_nas_timezone }}"
|
|
|
|
PUID: "{{ radarr_user_id }}"
|
|
|
|
PGID: "{{ radarr_group_id }}"
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
memory: "{{ radarr_memory }}"
|
|
|
|
labels:
|
|
|
|
traefik.enable: "{{ radarr_available_externally | string }}"
|
|
|
|
traefik.http.routers.radarr.rule: "Host(`{{ radarr_hostname }}.{{ ansible_nas_domain }}`)"
|
|
|
|
traefik.http.routers.radarr.tls.certresolver: "letsencrypt"
|
|
|
|
traefik.http.routers.radarr.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.routers.radarr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
|
|
|
traefik.http.services.radarr.loadbalancer.server.port: "7878"
|
2024-02-26 16:23:00 +00:00
|
|
|
homepage.group: "Download Tools"
|
|
|
|
homepage.name: "Radarr"
|
|
|
|
homepage.icon: "radarr"
|
|
|
|
homepage.href: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:{{ radarr_port }}"
|
|
|
|
|
2023-03-10 15:40:33 +00:00
|
|
|
when: radarr_enabled is true
|
|
|
|
|
|
|
|
- name: Stop Radarr
|
|
|
|
block:
|
|
|
|
- name: Stop Radarr
|
|
|
|
community.docker.docker_container:
|
|
|
|
name: "{{ radarr_container_name }}"
|
|
|
|
state: absent
|
|
|
|
when: radarr_enabled is false
|