From 88a0c46595490d42bf6788977730b88e27e7c9e9 Mon Sep 17 00:00:00 2001 From: Dave Stephens Date: Fri, 22 Jan 2021 15:35:08 +0000 Subject: [PATCH] Move Sonarr to ansible role --- group_vars/all.yml | 12 ------------ nas.yml | 9 +++++---- roles/sonarr/defaults/main.yml | 16 ++++++++++++++++ tasks/sonarr.yml => roles/sonarr/tasks/main.yml | 2 +- 4 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 roles/sonarr/defaults/main.yml rename tasks/sonarr.yml => roles/sonarr/tasks/main.yml (90%) diff --git a/group_vars/all.yml b/group_vars/all.yml index e27554e2..4baf76a5 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -23,8 +23,6 @@ pyload_enabled: false tautulli_enabled: false # Media Sourcing -sonarr_enabled: false # tv - get_iplayer_enabled: false jackett_enabled: false minidlna_enabled: false @@ -315,16 +313,6 @@ mylar_port_http: "8585" mylar_user_id: "0" mylar_group_id: "0" -### -### Sonarr -### -sonarr_available_externally: "false" -sonarr_data_directory: "{{ docker_home }}/sonarr/config" -sonarr_tv_directory: "{{ tv_root }}" -sonarr_download_directory: "{{ downloads_root }}" -sonarr_user_id: "0" -sonarr_group_id: "0" -sonarr_port: "8989" ### ### YouTubeDL-Material diff --git a/nas.yml b/nas.yml index c07a0ba3..ebcf2c92 100644 --- a/nas.yml +++ b/nas.yml @@ -143,6 +143,11 @@ - sickchill when: (sickchill_enabled | default(False)) + - role: sonarr + tags: + - sonarr + when: (sonarr_enabled | default(False)) + - role: transmission tags: - transmission @@ -189,10 +194,6 @@ when: (mylar_enabled | default(False)) tags: mylar - - import_tasks: tasks/sonarr.yml - when: (sonarr_enabled | default(False)) - tags: sonarr - - import_tasks: tasks/glances.yml when: (glances_enabled | default(False)) tags: glances diff --git a/roles/sonarr/defaults/main.yml b/roles/sonarr/defaults/main.yml new file mode 100644 index 00000000..9004c5f0 --- /dev/null +++ b/roles/sonarr/defaults/main.yml @@ -0,0 +1,16 @@ +--- +sonarr_enabled: false +sonarr_available_externally: "false" + +# directories +sonarr_data_directory: "{{ docker_home }}/sonarr/config" +sonarr_tv_directory: "{{ tv_root }}" +sonarr_download_directory: "{{ downloads_root }}" + +# uid / gid +sonarr_user_id: "0" +sonarr_group_id: "0" + +# network +sonarr_port: "8989" +sonarr_hostname: "sonarr" \ No newline at end of file diff --git a/tasks/sonarr.yml b/roles/sonarr/tasks/main.yml similarity index 90% rename from tasks/sonarr.yml rename to roles/sonarr/tasks/main.yml index bfd3f8d4..8af72def 100644 --- a/tasks/sonarr.yml +++ b/roles/sonarr/tasks/main.yml @@ -25,7 +25,7 @@ memory: 1g labels: traefik.enable: "{{ sonarr_available_externally }}" - traefik.http.routers.sonarr.rule: "Host(`sonarr.{{ ansible_nas_domain }}`)" + traefik.http.routers.sonarr.rule: "Host(`{{ sonarr_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.sonarr.tls.certresolver: "letsencrypt" traefik.http.routers.sonarr.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.sonarr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"