diff --git a/group_vars/all.yml b/group_vars/all.yml index 56a35837..279a7a8a 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -15,15 +15,7 @@ ### Ansible-NAS Applications ### -# Downloading -nzbget_enabled: false -pyload_enabled: false - -# Media Serving -tautulli_enabled: false - # Media Sourcing -get_iplayer_enabled: false jackett_enabled: false minidlna_enabled: false jellyfin_enabled: false @@ -270,16 +262,6 @@ joomla_available_externally: "false" joomla_database_password: top_secret joomla_port: "8181" -### -### pyLoad -### -pyload_available_externally: "false" -pyload_config_directory: "{{ docker_home }}/pyload" -pyload_download_directory: "{{ downloads_root }}" -pyload_user_id: "0" -pyload_group_id: "0" -pyload_port: "8000" - ### ### PyTivo ### @@ -302,16 +284,6 @@ homebridge_user_id: "0" homebridge_group_id: "0" homebridge_port: "8087" - -### -### Tautulli -### -tautulli_available_externally: "false" -tautulli_config_directory: "{{ docker_home }}/tautulli/config" -tautulli_user_id: "0" -tautulli_group_id: "0" -tautulli_port: "8185" - ### ### Mylar ### @@ -443,13 +415,6 @@ minidlna_media_directory2: "{{ tv_root }}" minidlna_friendly_name: "{{ ansible_nas_hostname }}" minidlna_port: "8201" -### -### get_iplayer -### -get_iplayer_config_directory: "{{ docker_home }}/get_iplayer" -get_iplayer_download_directory: "{{ tv_root }}/iplayer_downloads" -get_iplayer_port: "8182" - ### ### mymediaforalexa ### @@ -479,16 +444,6 @@ firefly_available_externally: "false" firefly_data_directory: "{{ docker_home }}/firefly" firefly_port: "8066" -### -### Nzbget -### -nzbget_available_externally: "false" -nzbget_data_directory: "{{ docker_home }}/nzbget" -nzbget_download_directory: "{{ downloads_root }}" -nzbget_user_id: "0" -nzbget_group_id: "0" -nzbget_port: "6789" - ### ### Wallabag ### diff --git a/nas.yml b/nas.yml index ede7fed6..a6638c6d 100644 --- a/nas.yml +++ b/nas.yml @@ -118,6 +118,11 @@ - nextcloud when: (nextcloud_enabled | default(False)) + - role: nzbget + tags: + - nzbget + when: (nzbget_enabled | default(False)) + - role: organizr tags: - organizr @@ -128,6 +133,11 @@ - portainer when: (portainer_enabled | default(False)) + - role: pyload + tags: + - pyload + when: (pyload_enabled | default(False)) + - role: ombi tags: - ombi @@ -163,6 +173,11 @@ - syncthing when: (syncthing_enabled | default(False)) + - role: tautulli + tags: + - tautulli + when: (tautulli_enabled | default(False)) + - role: transmission tags: - transmission @@ -193,14 +208,6 @@ when: (firefly_enabled | default(False)) tags: firefly - - import_tasks: tasks/tautulli.yml - when: (tautulli_enabled | default(False)) - tags: tautulli - - - import_tasks: tasks/pyload.yml - when: (pyload_enabled | default(False)) - tags: pyload - - import_tasks: tasks/thelounge.yml when: (thelounge_enabled | default(False)) tags: thelounge @@ -241,10 +248,6 @@ when: (minidlna_enabled | default(False)) tags: minidlna - - import_tasks: tasks/get_iplayer.yml - when: (get_iplayer_enabled | default(False)) - tags: get_iplayer - - import_tasks: tasks/mymediaforalexa.yml when: (mymediaforalexa_enabled | default(False)) tags: mymediaforalexa @@ -257,10 +260,6 @@ when: (joomla_enabled | default(False)) tags: joomla - - import_tasks: tasks/nzbget.yml - when: (nzbget_enabled | default(False)) - tags: nzbget - - import_tasks: tasks/wallabag.yml when: (wallabag_enabled | default(False)) tags: wallabag diff --git a/roles/application-template/defaults/main.yml b/roles/application-template/defaults/main.yml new file mode 100644 index 00000000..cfe279f7 --- /dev/null +++ b/roles/application-template/defaults/main.yml @@ -0,0 +1,21 @@ +--- +# enable or disable the application +example_app_enabled: false +example_app_available_externally: "false" + +# directories +example_app_config_directory: "{{ docker_home }}/example_app/config" +example_app_logs: "{{ docker_home }}/example_app/logs" +example_app_share_directory: "{{ example_share_root }}" + + +# uid / gid +example_app_user_id: "0" +example_app_group_id: "0" + +# network +example_app_hostname: "example_app" +example_app_port: "12345" + +# specs +example_app_memory: "1g" diff --git a/roles/application-template/tasks/main.yml b/roles/application-template/tasks/main.yml new file mode 100644 index 00000000..73121a17 --- /dev/null +++ b/roles/application-template/tasks/main.yml @@ -0,0 +1,36 @@ +--- +- name: Create Example_App Directories + file: + path: "{{ item }}" + state: directory + # mode: 0755 + with_items: + - "{{ example_app_config_directory }}" + - "{{ example_app_logs }}" + +- name: example_app Docker Container + docker_container: + name: example_app + image: example_app/example_app + pull: true + volumes: + - "{{ example_app_config_directory }}:/config:rw" + - "{{ example_app_logs }}:/logs:rw" + - "{{ example_app_data_directory }}:/data:rw" + network_mode: "bridge" + ports: + - "{{ example_app_port_a }}:80" + - "{{ example_app_port_b }}:80" + env: + TZ: "{{ ansible_nas_timezone }}" + PUID: "{{ example_app_user_id }}" + PGID: "{{ example_app_group_id }}" + restart_policy: unless-stopped + memory: "{{ example_app_memory }}" + labels: + traefik.enable: "{{ example_app_available_externally }}" + traefik.http.routers.example_app.rule: "Host(`{{ example_app_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.example_app.tls.certresolver: "letsencrypt" + traefik.http.routers.example_app.tls.domains[0].main: "{{ ansible_nas_domain }}" + traefik.http.routers.example_app.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" + traefik.http.services.example_app.loadbalancer.server.port: "80" diff --git a/roles/get-iplayer/defaults/main.yml b/roles/get-iplayer/defaults/main.yml new file mode 100644 index 00000000..c45a0124 --- /dev/null +++ b/roles/get-iplayer/defaults/main.yml @@ -0,0 +1,12 @@ +--- +get_iplayer_enabled: false + +# directories +get_iplayer_config_directory: "{{ docker_home }}/get_iplayer" +get_iplayer_download_directory: "{{ tv_root }}/iplayer_downloads" + +# network +get_iplayer_port: "8182" + +# specs +get_iplayer_memory: "1g" diff --git a/tasks/get_iplayer.yml b/roles/get-iplayer/tasks/main.yml similarity index 93% rename from tasks/get_iplayer.yml rename to roles/get-iplayer/tasks/main.yml index 2a25a4b0..e4e32bfb 100644 --- a/tasks/get_iplayer.yml +++ b/roles/get-iplayer/tasks/main.yml @@ -17,5 +17,5 @@ ports: - "{{ get_iplayer_port }}:8181" restart_policy: unless-stopped - memory: 1g + memory: "{{ get_iplayer_memory }}" diff --git a/roles/nzbget/defaults/main.yml b/roles/nzbget/defaults/main.yml new file mode 100644 index 00000000..4ba6dc2d --- /dev/null +++ b/roles/nzbget/defaults/main.yml @@ -0,0 +1,18 @@ +--- +nzbget_enabled: false +nzbget_available_externally: "false" + +# directories +nzbget_data_directory: "{{ docker_home }}/nzbget" +nzbget_download_directory: "{{ downloads_root }}" + +# uid / gid +nzbget_user_id: "0" +nzbget_group_id: "0" + +# network +nzbget_port: "6789" +nzbget_hostname: "nzbget" + +# specs +nzbget_app_memory: "1g" diff --git a/tasks/nzbget.yml b/roles/nzbget/tasks/main.yml similarity index 90% rename from tasks/nzbget.yml rename to roles/nzbget/tasks/main.yml index b66c5b68..bd27a9e1 100644 --- a/tasks/nzbget.yml +++ b/roles/nzbget/tasks/main.yml @@ -24,7 +24,7 @@ memory: 1g labels: traefik.enable: "{{ nzbget_available_externally }}" - traefik.http.routers.nzbget.rule: "Host(`nzbget.{{ ansible_nas_domain }}`)" + traefik.http.routers.nzbget.rule: "Host(`{{ nzbget_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.nzbget.tls.certresolver: "letsencrypt" traefik.http.routers.nzbget.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.nzbget.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/roles/pyload/defaults/main.yml b/roles/pyload/defaults/main.yml new file mode 100644 index 00000000..2053c1f7 --- /dev/null +++ b/roles/pyload/defaults/main.yml @@ -0,0 +1,19 @@ +--- +pyload_enabled: false +pyload_available_externally: "false" + +# directories +pyload_config_directory: "{{ docker_home }}/pyload" +pyload_download_directory: "{{ downloads_root }}" + + +# uid / gid +pyload_user_id: "0" +pyload_group_id: "0" + +# network +pyload_hostname: "pyload" +pyload_port: "8000" + +# specs +pyload_memory: "1g" diff --git a/tasks/pyload.yml b/roles/pyload/tasks/main.yml similarity index 88% rename from tasks/pyload.yml rename to roles/pyload/tasks/main.yml index 3f783c3a..c758c954 100644 --- a/tasks/pyload.yml +++ b/roles/pyload/tasks/main.yml @@ -23,10 +23,10 @@ UID: "{{ pyload_user_id }}" GID: "{{ pyload_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ pyload_memory }}" labels: traefik.enable: "{{ pyload_available_externally }}" - traefik.http.routers.pyload.rule: "Host(`pyload.{{ ansible_nas_domain }}`)" + traefik.http.routers.pyload.rule: "Host(`{{ pyload_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.pyload.tls.certresolver: "letsencrypt" traefik.http.routers.pyload.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.pyload.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/roles/tautulli/defaults/main.yml b/roles/tautulli/defaults/main.yml new file mode 100644 index 00000000..95a0cc95 --- /dev/null +++ b/roles/tautulli/defaults/main.yml @@ -0,0 +1,17 @@ +--- +tautulli_enabled: false +tautulli_available_externally: "false" + +# directories +tautulli_config_directory: "{{ docker_home }}/tautulli/config" + +# uid / gid +tautulli_user_id: "0" +tautulli_group_id: "0" + +# network +tautulli_hostname: "tautulli" +tautulli_port: "8185" + +# specs +tautulli_memory: "1g" diff --git a/tasks/tautulli.yml b/roles/tautulli/tasks/main.yml similarity index 87% rename from tasks/tautulli.yml rename to roles/tautulli/tasks/main.yml index 277d4f65..2b481399 100644 --- a/tasks/tautulli.yml +++ b/roles/tautulli/tasks/main.yml @@ -22,10 +22,10 @@ PUID: "{{ tautulli_user_id }}" PGID: "{{ tautulli_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ tautulli_memory }}" labels: traefik.enable: "{{ tautulli_available_externally }}" - traefik.http.routers.tautulli.rule: "Host(`tautulli.{{ ansible_nas_domain }}`)" + traefik.http.routers.tautulli.rule: "Host(`{{ tautulli_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.tautulli.tls.certresolver: "letsencrypt" traefik.http.routers.tautulli.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.tautulli.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"