diff --git a/group_vars/all.yml b/group_vars/all.yml index 56a35837..e2a895bf 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -30,7 +30,6 @@ jellyfin_enabled: false youtubedlmaterial_enabled: false -mylar_enabled: false # Music mymediaforalexa_enabled: false @@ -312,18 +311,6 @@ tautulli_user_id: "0" tautulli_group_id: "0" tautulli_port: "8185" -### -### Mylar -### -mylar_available_externally: "false" -mylar_data_directory: "{{ docker_home }}/mylar" -mylar_comics_directory: "{{ comics_root }}" -mylar_downloads_directory: "{{ downloads_root }}" -mylar_port_http: "8585" -mylar_user_id: "0" -mylar_group_id: "0" - - ### ### YouTubeDL-Material ### diff --git a/nas.yml b/nas.yml index ede7fed6..4c0bf6f3 100644 --- a/nas.yml +++ b/nas.yml @@ -103,6 +103,11 @@ - lidarr when: (lidarr_enabled | default(False)) + - role: mylar + tags: + - mylar + when: (mylar_enabled | default(False)) + - role: n8n tags: - n8n_enabled @@ -205,10 +210,6 @@ when: (thelounge_enabled | default(False)) tags: thelounge - - import_tasks: tasks/mylar.yml - when: (mylar_enabled | default(False)) - tags: mylar - - import_tasks: tasks/glances.yml when: (glances_enabled | default(False)) tags: glances diff --git a/roles/mylar/defaults/main.yml b/roles/mylar/defaults/main.yml new file mode 100644 index 00000000..73e3d724 --- /dev/null +++ b/roles/mylar/defaults/main.yml @@ -0,0 +1,21 @@ +--- +# enable or disable the application +mylar_enabled: false +mylar_available_externally: "false" + +# directories +mylar_data_directory: "{{ docker_home }}/mylar" +mylar_comics_directory: "{{ comics_root }}" +mylar_downloads_directory: "{{ downloads_root }}" + + +# uid / gid +mylar_user_id: "0" +mylar_group_id: "0" + +# network +mylar_hostname: "mylar" +mylar_port_http: "8585" + +# specs +mylar_memory: "1g" diff --git a/tasks/mylar.yml b/roles/mylar/tasks/main.yml similarity index 79% rename from tasks/mylar.yml rename to roles/mylar/tasks/main.yml index 40a4e819..879d1d17 100644 --- a/tasks/mylar.yml +++ b/roles/mylar/tasks/main.yml @@ -1,12 +1,13 @@ --- -- name: Create Mylar Directory +- name: Create Mylar Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ mylar_data_directory }}/config" -- name: Mylar +- name: mylar Docker Container docker_container: name: mylar image: linuxserver/mylar @@ -15,6 +16,7 @@ - "{{ mylar_comics_directory }}:/comics:rw" - "{{ mylar_downloads_directory }}:/downloads:rw" - "{{ mylar_data_directory }}/config:/config:rw" + network_mode: "bridge" ports: - "{{ mylar_port_http }}:8090" env: @@ -22,10 +24,10 @@ PUID: "{{ mylar_user_id }}" PGID: "{{ mylar_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ mylar_memory }}" labels: traefik.enable: "{{ mylar_available_externally }}" - traefik.http.routers.mylar.rule: "Host(`mylar.{{ ansible_nas_domain }}`)" + traefik.http.routers.mylar.rule: "Host(`{{ mylar_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.mylar.tls.certresolver: "letsencrypt" traefik.http.routers.mylar.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.mylar.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"