From 3657c4feda04317c5f27f85386fd8144a831e060 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 29 Jan 2021 00:08:36 -0900 Subject: [PATCH 01/15] Add template mv get_iplayer, nzbget, pyload, tautulli to roles --- group_vars/all.yml | 45 ------------------- nas.yml | 31 +++++++------ roles/application-template/defaults/main.yml | 21 +++++++++ roles/application-template/tasks/main.yml | 36 +++++++++++++++ roles/get-iplayer/defaults/main.yml | 12 +++++ .../get-iplayer/tasks/main.yml | 2 +- roles/nzbget/defaults/main.yml | 18 ++++++++ .../nzbget.yml => roles/nzbget/tasks/main.yml | 2 +- roles/pyload/defaults/main.yml | 19 ++++++++ .../pyload.yml => roles/pyload/tasks/main.yml | 4 +- roles/tautulli/defaults/main.yml | 17 +++++++ .../tautulli/tasks/main.yml | 4 +- 12 files changed, 144 insertions(+), 67 deletions(-) create mode 100644 roles/application-template/defaults/main.yml create mode 100644 roles/application-template/tasks/main.yml create mode 100644 roles/get-iplayer/defaults/main.yml rename tasks/get_iplayer.yml => roles/get-iplayer/tasks/main.yml (93%) create mode 100644 roles/nzbget/defaults/main.yml rename tasks/nzbget.yml => roles/nzbget/tasks/main.yml (90%) create mode 100644 roles/pyload/defaults/main.yml rename tasks/pyload.yml => roles/pyload/tasks/main.yml (88%) create mode 100644 roles/tautulli/defaults/main.yml rename tasks/tautulli.yml => roles/tautulli/tasks/main.yml (87%) 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 }}" From dda1f432ef7b85c66ebf79681f00e67729b78bb9 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 29 Jan 2021 00:47:56 -0900 Subject: [PATCH 02/15] mv jackett to role --- group_vars/all.yml | 9 --------- nas.yml | 9 +++++---- roles/jackett/defaults/main.yml | 15 +++++++++++++++ tasks/jackett.yml => roles/jackett/tasks/main.yml | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 roles/jackett/defaults/main.yml rename tasks/jackett.yml => roles/jackett/tasks/main.yml (89%) diff --git a/group_vars/all.yml b/group_vars/all.yml index 279a7a8a..e753528c 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -16,7 +16,6 @@ ### # Media Sourcing -jackett_enabled: false minidlna_enabled: false jellyfin_enabled: false @@ -421,14 +420,6 @@ minidlna_port: "8201" mymediaforalexa_media_directory: "{{ music_root }}" mymediaforalexa_data_directory: "{{ docker_home }}/mymediaforalexa" -### -### Jackett -### -jackett_available_externally: "false" -jackett_data_directory: "{{ docker_home }}/jackett" -jackett_torrents_root: "{{ torrents_root }}" -jackett_port: "9117" - ### ### The Lounge ### diff --git a/nas.yml b/nas.yml index a6638c6d..96726a5d 100644 --- a/nas.yml +++ b/nas.yml @@ -98,6 +98,11 @@ - homeassistant when: (homeassistant_enabled | default(False)) + - role: jackett + tags: + - jackett + when: (jackett_enabled | default(False)) + - role: lidarr tags: - lidarr @@ -252,10 +257,6 @@ when: (mymediaforalexa_enabled | default(False)) tags: mymediaforalexa - - import_tasks: tasks/jackett.yml - when: (jackett_enabled | default(False)) - tags: jackett - - import_tasks: tasks/joomla.yml when: (joomla_enabled | default(False)) tags: joomla diff --git a/roles/jackett/defaults/main.yml b/roles/jackett/defaults/main.yml new file mode 100644 index 00000000..6cfe892e --- /dev/null +++ b/roles/jackett/defaults/main.yml @@ -0,0 +1,15 @@ +--- +# enable or disable the application +jackett_enabled: false +jackett_available_externally: "false" + +# directories +jackett_data_directory: "{{ docker_home }}/jackett" +jackett_torrents_root: "{{ torrents_root }}" + +# network +jackett_hostname: "jackett" +jackett_port: "9117" + +# specs +jackett_memory: "1g" diff --git a/tasks/jackett.yml b/roles/jackett/tasks/main.yml similarity index 89% rename from tasks/jackett.yml rename to roles/jackett/tasks/main.yml index 18eed198..8aa82011 100644 --- a/tasks/jackett.yml +++ b/roles/jackett/tasks/main.yml @@ -21,7 +21,7 @@ restart_policy: unless-stopped labels: traefik.enable: "{{ jackett_available_externally }}" - traefik.http.routers.jackett.rule: "Host(`jackett.{{ ansible_nas_domain }}`)" + traefik.http.routers.jackett.rule: "Host(`{{ jackett_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.jackett.tls.certresolver: "letsencrypt" traefik.http.routers.jackett.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.jackett.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" From cf0db6d8628c40a1b9ac420ba1d0fe77684209a0 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 5 Feb 2021 15:18:35 -0900 Subject: [PATCH 03/15] fix review items --- nas.yml | 5 +++ roles/application-template/defaults/main.yml | 21 ----------- roles/application-template/tasks/main.yml | 36 ------------------- .../defaults/main.yml | 0 .../tasks/main.yml | 0 5 files changed, 5 insertions(+), 57 deletions(-) delete mode 100644 roles/application-template/defaults/main.yml delete mode 100644 roles/application-template/tasks/main.yml rename roles/{get-iplayer => get_iplayer}/defaults/main.yml (100%) rename roles/{get-iplayer => get_iplayer}/tasks/main.yml (100%) diff --git a/nas.yml b/nas.yml index 89b20996..6661430e 100644 --- a/nas.yml +++ b/nas.yml @@ -88,6 +88,11 @@ - gitea when: (gitea_enabled | default(False)) + - role: get_iplayer + tags: + - get_iplayer + when: (get_iplayer_enabled | default(False)) + - role: heimdall tags: - heimdall diff --git a/roles/application-template/defaults/main.yml b/roles/application-template/defaults/main.yml deleted file mode 100644 index cfe279f7..00000000 --- a/roles/application-template/defaults/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# 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 deleted file mode 100644 index 73121a17..00000000 --- a/roles/application-template/tasks/main.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- 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 similarity index 100% rename from roles/get-iplayer/defaults/main.yml rename to roles/get_iplayer/defaults/main.yml diff --git a/roles/get-iplayer/tasks/main.yml b/roles/get_iplayer/tasks/main.yml similarity index 100% rename from roles/get-iplayer/tasks/main.yml rename to roles/get_iplayer/tasks/main.yml From 88604efebbf8f6ff0eba700a68ed1a4cb884527b Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 5 Feb 2021 22:33:05 -0900 Subject: [PATCH 04/15] mv mymediaforalexa to roles --- group_vars/all.yml | 9 --------- nas.yml | 9 +++++---- roles/mymediaforalexa/defaults/main.yml | 9 +++++++++ .../mymediaforalexa/tasks/main.yml | 11 ++++++----- 4 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 roles/mymediaforalexa/defaults/main.yml rename tasks/mymediaforalexa.yml => roles/mymediaforalexa/tasks/main.yml (71%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..39327b48 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -30,9 +30,6 @@ jellyfin_enabled: false youtubedlmaterial_enabled: false -# Music -mymediaforalexa_enabled: false - # News miniflux_enabled: false @@ -428,12 +425,6 @@ get_iplayer_config_directory: "{{ docker_home }}/get_iplayer" get_iplayer_download_directory: "{{ tv_root }}/iplayer_downloads" get_iplayer_port: "8182" -### -### mymediaforalexa -### -mymediaforalexa_media_directory: "{{ music_root }}" -mymediaforalexa_data_directory: "{{ docker_home }}/mymediaforalexa" - ### ### Jackett ### diff --git a/nas.yml b/nas.yml index b3d30af3..62650d5b 100644 --- a/nas.yml +++ b/nas.yml @@ -113,6 +113,11 @@ - mylar when: (mylar_enabled | default(False)) + - role: mymediaforalexa + tags: + - mymediaforalexa + when: (mymediaforalexa_enabled | default(False)) + - role: n8n tags: - n8n_enabled @@ -247,10 +252,6 @@ when: (get_iplayer_enabled | default(False)) tags: get_iplayer - - import_tasks: tasks/mymediaforalexa.yml - when: (mymediaforalexa_enabled | default(False)) - tags: mymediaforalexa - - import_tasks: tasks/jackett.yml when: (jackett_enabled | default(False)) tags: jackett diff --git a/roles/mymediaforalexa/defaults/main.yml b/roles/mymediaforalexa/defaults/main.yml new file mode 100644 index 00000000..f4ca0800 --- /dev/null +++ b/roles/mymediaforalexa/defaults/main.yml @@ -0,0 +1,9 @@ +--- +# enable or disable the application +mymediaforalexa_enabled: false +# directories +mymediaforalexa_media_directory: "{{ music_root }}" +mymediaforalexa_data_directory: "{{ docker_home }}/mymediaforalexa" + +# specs +mymediaforalexa_memory: "1g" diff --git a/tasks/mymediaforalexa.yml b/roles/mymediaforalexa/tasks/main.yml similarity index 71% rename from tasks/mymediaforalexa.yml rename to roles/mymediaforalexa/tasks/main.yml index 6bddb54e..a896a034 100644 --- a/tasks/mymediaforalexa.yml +++ b/roles/mymediaforalexa/tasks/main.yml @@ -1,12 +1,14 @@ -- name: Create mymedia for alexa Directories +--- +- name: Create Mymediaforalexa Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ mymediaforalexa_media_directory }}" - "{{ mymediaforalexa_data_directory }}" -- name: mymedia for alexa Docker Container +- name: mymediaforalexa Docker Container docker_container: name: mymediaforalexa image: bizmodeller/mymediaforalexa @@ -14,7 +16,6 @@ volumes: - "{{ mymediaforalexa_media_directory }}:/medialibrary:rw" - "{{ mymediaforalexa_data_directory }}:/datadir:rw" - network_mode: host + network_mode: "host" restart_policy: unless-stopped - memory: 1g - + memory: "{{ mymediaforalexa_memory }}" From 6d89265cc053b7b16c742036eac5833e0bec88b2 Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 5 Feb 2021 23:14:58 -0900 Subject: [PATCH 05/15] mv cloudcmd to roles --- group_vars/all.yml | 11 ----------- nas.yml | 9 +++++---- roles/cloudcmd/defaults/main.yml | 19 +++++++++++++++++++ .../cloudcmd/tasks/main.yml | 12 +++++++----- 4 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 roles/cloudcmd/defaults/main.yml rename tasks/cloudcmd.yml => roles/cloudcmd/tasks/main.yml (77%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..dedc8cd1 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -40,7 +40,6 @@ miniflux_enabled: false glances_enabled: false stats_enabled: false guacamole_enabled: false -cloudcmd_enabled: false virtual_desktop_enabled: false krusader_enabled: false @@ -388,16 +387,6 @@ miniflux_admin_username: admin miniflux_admin_password: supersecure miniflux_port: "8070" -### -### CloudCmd -### -cloudcmd_available_externally: "false" -cloudcmd_data_directory: "{{ docker_home }}/cloudcmd/config" -cloudcmd_browse_directory: "/" -cloudcmd_user_id: "0" -cloudcmd_group_id: "0" -cloudcmd_port: "7373" - ### ### Krusader ### diff --git a/nas.yml b/nas.yml index b3d30af3..99a22e7e 100644 --- a/nas.yml +++ b/nas.yml @@ -58,6 +58,11 @@ - bitwarden when: (bitwarden_enabled | default(False)) + - role: cloudcmd + tags: + - cloudcmd + when: (cloudcmd_enabled | default(False)) + - role: cloudflare_ddns tags: - cloudflare_ddns @@ -287,10 +292,6 @@ when: (jellyfin_enabled | default(False)) tags: jellyfin - - import_tasks: tasks/cloudcmd.yml - when: (cloudcmd_enabled | default(False)) - tags: cloudcmd - - import_tasks: tasks/krusader.yml when: (krusader_enabled | default(False)) tags: krusader diff --git a/roles/cloudcmd/defaults/main.yml b/roles/cloudcmd/defaults/main.yml new file mode 100644 index 00000000..2bf86018 --- /dev/null +++ b/roles/cloudcmd/defaults/main.yml @@ -0,0 +1,19 @@ +--- +# enable or disable the application +cloudcmd_enabled: false +cloudcmd_available_externally: "false" + +# directories +cloudcmd_data_directory: "{{ docker_home }}/cloudcmd/config" +cloudcmd_browse_directory: "/" + +# uid / gid +cloudcmd_user_id: "0" +cloudcmd_group_id: "0" + +# network +cloudcmd_hostname: "cloudcmd" +cloudcmd_port: "7373" + +# specs +cloudcmd_memory: "1g" diff --git a/tasks/cloudcmd.yml b/roles/cloudcmd/tasks/main.yml similarity index 77% rename from tasks/cloudcmd.yml rename to roles/cloudcmd/tasks/main.yml index f67936d0..5ce840ca 100644 --- a/tasks/cloudcmd.yml +++ b/roles/cloudcmd/tasks/main.yml @@ -1,12 +1,13 @@ --- -- name: Create CloudCmd Directories +- name: Create Cloudcmd Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ cloudcmd_data_directory }}" -- name: CloudCmd +- name: Create Cloudcmd Docker Container docker_container: name: cloudcmd image: coderaiser/cloudcmd @@ -14,6 +15,7 @@ volumes: - "{{ cloudcmd_data_directory }}:/config:rw" - "{{ cloudcmd_browse_directory }}:/mnt/fs" + network_mode: "bridge" ports: - "{{ cloudcmd_port }}:8000" env: @@ -21,11 +23,11 @@ PUID: "{{ cloudcmd_user_id }}" PGID: "{{ cloudcmd_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ cloudcmd_memory }}" labels: traefik.enable: "{{ cloudcmd_available_externally }}" - traefik.http.routers.cloudcmd.rule: "Host(`cloudcmd.{{ ansible_nas_domain }}`)" + traefik.http.routers.cloudcmd.rule: "Host(`{{ cloudcmd_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.cloudcmd.tls.certresolver: "letsencrypt" traefik.http.routers.cloudcmd.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.cloudcmd.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" - traefik.http.services.cloudcmd.loadbalancer.server.port: "8000" \ No newline at end of file + traefik.http.services.cloudcmd.loadbalancer.server.port: "8000" From 0b74fc2e7a8837b1499e472c4f826ed9e99c989b Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Sat, 6 Feb 2021 02:21:23 -0900 Subject: [PATCH 06/15] move firefly to role --- group_vars/all.yml | 10 ---------- nas.yml | 10 +++++----- roles/firefly/defaults/main.yml | 14 ++++++++++++++ tasks/firefly.yml => roles/firefly/tasks/main.yml | 7 +++++-- 4 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 roles/firefly/defaults/main.yml rename tasks/firefly.yml => roles/firefly/tasks/main.yml (90%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..47f7056d 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -54,9 +54,6 @@ gitlab_enabled: false znc_enabled: false thelounge_enabled: false -# Finance -firefly_enabled: false - # Wallabag wallabag_enabled: false @@ -450,13 +447,6 @@ thelounge_data_directory: "{{ docker_home }}/thelounge" thelounge_port_one: "113" thelounge_port_two: "9002" -### -### Firefly -### -firefly_available_externally: "false" -firefly_data_directory: "{{ docker_home }}/firefly" -firefly_port: "8066" - ### ### Nzbget ### diff --git a/nas.yml b/nas.yml index b3d30af3..7948ab84 100644 --- a/nas.yml +++ b/nas.yml @@ -83,6 +83,11 @@ - emby when: (emby_enabled | default(False)) + - role: firefly + tags: + - firefly + when: (firefly_enabled | default(False)) + - role: gitea tags: - gitea @@ -198,11 +203,6 @@ - watchtower when: (watchtower_enabled | default(False)) - tasks: - - import_tasks: tasks/firefly.yml - when: (firefly_enabled | default(False)) - tags: firefly - - import_tasks: tasks/tautulli.yml when: (tautulli_enabled | default(False)) tags: tautulli diff --git a/roles/firefly/defaults/main.yml b/roles/firefly/defaults/main.yml new file mode 100644 index 00000000..4722d2e7 --- /dev/null +++ b/roles/firefly/defaults/main.yml @@ -0,0 +1,14 @@ +--- +# enable or disable the application +firefly_enabled: false +firefly_available_externally: "false" + +# directories +firefly_data_directory: "{{ docker_home }}/firefly" + +# network +firefly_hostname: "firefly" +firefly_port: "8066" + +# specs +firefly_memory: "1g" diff --git a/tasks/firefly.yml b/roles/firefly/tasks/main.yml similarity index 90% rename from tasks/firefly.yml rename to roles/firefly/tasks/main.yml index 04516bd4..0a8843e5 100644 --- a/tasks/firefly.yml +++ b/roles/firefly/tasks/main.yml @@ -1,7 +1,9 @@ +--- - name: Create Firefly III Directories file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ firefly_data_directory }}/postgresql" - "{{ firefly_data_directory }}/mysql" @@ -37,6 +39,7 @@ - "{{ firefly_data_directory }}/upload:/var/www/firefly-iii/storage/upload:rw" links: - firefly-mysql:db + network_mode: "bridge" ports: - "{{ firefly_port }}:8080" env: @@ -49,10 +52,10 @@ DB_PASSWORD: "firefly" TZ: "{{ ansible_nas_timezone }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ firefly_memory }}" labels: traefik.enable: "{{ firefly_available_externally }}" - traefik.http.routers.firefly.rule: "Host(`firefly.{{ ansible_nas_domain }}`)" + traefik.http.routers.firefly.rule: "Host(`{{ firefly_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.firefly.tls.certresolver: "letsencrypt" traefik.http.routers.firefly.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.firefly.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" From 8067631cb0672b16ca0f4431e0e0993847f8c20f Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Sun, 7 Feb 2021 13:55:49 -0900 Subject: [PATCH 07/15] move homebridge to role --- group_vars/all.yml | 11 ----------- nas.yml | 9 +++++---- roles/homebridge/defaults/main.yml | 18 ++++++++++++++++++ .../homebridge/tasks/main.yml | 9 +++++---- 4 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 roles/homebridge/defaults/main.yml rename tasks/homebridge.yml => roles/homebridge/tasks/main.yml (80%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..e96fa8dc 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -62,7 +62,6 @@ wallabag_enabled: false # Home Automation mosquitto_enabled: false -homebridge_enabled: false openhab_enabled: false # Books @@ -291,16 +290,6 @@ pytivo_podcasts_directory: "{{ podcasts_root }}" pytivo_user_id: "0" pytivo_group_id: "0" -### -### Homebridge -### -homebridge_available_externally: "false" -homebridge_config_directory: "{{ docker_home }}/homebridge/config" -homebridge_user_id: "0" -homebridge_group_id: "0" -homebridge_port: "8087" - - ### ### Tautulli ### diff --git a/nas.yml b/nas.yml index b3d30af3..4083e61d 100644 --- a/nas.yml +++ b/nas.yml @@ -98,6 +98,11 @@ - homeassistant when: (homeassistant_enabled | default(False)) + - role: homebridge + tags: + - homebridge + when: (homebridge_enabled | default(False)) + - role: lidarr tags: - lidarr @@ -271,10 +276,6 @@ when: (mosquitto_enabled | default(False)) tags: mosquitto - - import_tasks: tasks/homebridge.yml - when: (homebridge_enabled | default(False)) - tags: homebridge - - import_tasks: tasks/calibre.yml when: (calibre_enabled | default(False)) tags: calibre diff --git a/roles/homebridge/defaults/main.yml b/roles/homebridge/defaults/main.yml new file mode 100644 index 00000000..700a817f --- /dev/null +++ b/roles/homebridge/defaults/main.yml @@ -0,0 +1,18 @@ +--- +# enable or disable the application +homebridge_enabled: false +homebridge_available_externally: "false" + +# directories +homebridge_config_directory: "{{ docker_home }}/homebridge/config" + +# uid / gid +homebridge_user_id: "0" +homebridge_group_id: "0" + +# network +homebridge_hostname: "homebridge" +homebridge_port: "8087" + +# specs +homebridge_memory: "1g" diff --git a/tasks/homebridge.yml b/roles/homebridge/tasks/main.yml similarity index 80% rename from tasks/homebridge.yml rename to roles/homebridge/tasks/main.yml index f54c42db..7ea1343f 100644 --- a/tasks/homebridge.yml +++ b/roles/homebridge/tasks/main.yml @@ -3,17 +3,18 @@ file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ homebridge_config_directory }}" -- name: Homebridge Docker Container +- name: Create Homebridge Docker Container docker_container: name: homebridge image: oznu/homebridge pull: true volumes: - "{{ homebridge_config_directory }}:/homebridge" - network_mode: host + network_mode: "host" env: TZ: "{{ ansible_nas_timezone }}" PGID: "{{ homebridge_group_id }}" @@ -21,10 +22,10 @@ HOMEBRIDGE_CONFIG_UI: "1" HOMEBRIDGE_CONFIG_UI_PORT: "{{ homebridge_port }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ homebridge_memory }}" labels: traefik.enable: "{{ homebridge_available_externally }}" - traefik.http.routers.homebridge.rule: "Host(`homebridge.{{ ansible_nas_domain }}`)" + traefik.http.routers.homebridge.rule: "Host(`{{ homebridge_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.homebridge.tls.certresolver: "letsencrypt" traefik.http.routers.homebridge.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.homebridge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" From 4d44ad017d04b07e5c7284765747cc2b1bc3e1cd Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Sun, 7 Feb 2021 14:38:10 -0900 Subject: [PATCH 08/15] move znc to role --- group_vars/all.yml | 12 ------------ nas.yml | 9 +++++---- roles/znc/defaults/main.yml | 18 ++++++++++++++++++ tasks/znc.yml => roles/znc/tasks/main.yml | 10 ++++++---- 4 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 roles/znc/defaults/main.yml rename tasks/znc.yml => roles/znc/tasks/main.yml (79%) diff --git a/group_vars/all.yml b/group_vars/all.yml index ea422fcb..2d922f84 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -51,7 +51,6 @@ timemachine_enabled: false gitlab_enabled: false # IRC -znc_enabled: false thelounge_enabled: false # Finance @@ -326,17 +325,6 @@ youtubedlmaterial_port_http: "8998" ### openvpn_config_directory: "{{ docker_home }}/openvpn" - -### -### ZNC -### -znc_available_externally: "false" -znc_data_directory: "{{ docker_home }}/znc" -znc_user_id: "0" -znc_group_id: "0" -znc_port: "6677" - - ### ### Stats ### diff --git a/nas.yml b/nas.yml index b3d30af3..aab7ea22 100644 --- a/nas.yml +++ b/nas.yml @@ -198,6 +198,11 @@ - watchtower when: (watchtower_enabled | default(False)) + - role: znc + tags: + - znc + when: (znc_enabled | default(False)) + tasks: - import_tasks: tasks/firefly.yml when: (firefly_enabled | default(False)) @@ -219,10 +224,6 @@ when: (glances_enabled | default(False)) tags: glances - - import_tasks: tasks/znc.yml - when: (znc_enabled | default(False)) - tags: znc - - import_tasks: tasks/miniflux.yml when: (miniflux_enabled | default(False)) tags: miniflux diff --git a/roles/znc/defaults/main.yml b/roles/znc/defaults/main.yml new file mode 100644 index 00000000..ec9bb937 --- /dev/null +++ b/roles/znc/defaults/main.yml @@ -0,0 +1,18 @@ +--- +# enable or disable the application +znc_enabled: false +znc_available_externally: "false" + +# directories +znc_data_directory: "{{ docker_home }}/znc" + +# uid / gid +znc_user_id: "0" +znc_group_id: "0" + +# network +znc_hostname: "znc" +znc_port: "6677" + +# specs +znc_memory: "1g" diff --git a/tasks/znc.yml b/roles/znc/tasks/main.yml similarity index 79% rename from tasks/znc.yml rename to roles/znc/tasks/main.yml index 2401b53b..084fa310 100644 --- a/tasks/znc.yml +++ b/roles/znc/tasks/main.yml @@ -3,10 +3,11 @@ file: path: "{{ item }}" state: directory + # mode: 0755 with_items: - "{{ znc_data_directory }}" -- name: ZNC +- name: Create ZNC Docker Container docker_container: name: znc image: znc @@ -14,17 +15,18 @@ volumes: - "{{ znc_data_directory }}:/znc-data:rw" - "/etc/timezone:/etc/timezone:ro" + network_mode: "bridge" ports: - "{{ znc_port }}:6677" env: PUID: "{{ znc_user_id }}" PGID: "{{ znc_group_id }}" restart_policy: unless-stopped - memory: 1g + memory: "{{ znc_memory }}" labels: traefik.enable: "{{ znc_available_externally }}" - traefik.http.routers.znc.rule: "Host(`znc.{{ ansible_nas_domain }}`)" + traefik.http.routers.znc.rule: "Host(`{{ znc_hostname }}.{{ ansible_nas_domain }}`)" traefik.http.routers.znc.tls.certresolver: "letsencrypt" traefik.http.routers.znc.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.znc.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" - traefik.http.services.znc.loadbalancer.server.port: "6677" \ No newline at end of file + traefik.http.services.znc.loadbalancer.server.port: "6677" From fcf5d4c429e770bc38554f8b4fca8078c035dfe8 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Mon, 8 Feb 2021 14:00:41 +0000 Subject: [PATCH 09/15] Damn you YAML! --- nas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nas.yml b/nas.yml index b3d30af3..93b8eec0 100644 --- a/nas.yml +++ b/nas.yml @@ -103,7 +103,7 @@ - lidarr when: (lidarr_enabled | default(False)) - - role: minidlna + - role: minidlna tags: - minidlna when: (minidlna_enabled | default(False)) From 097d58f1d743a0e94856007f7f02c9340e0c29f1 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:15:58 +0000 Subject: [PATCH 10/15] Remove explicit network mode --- roles/znc/tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/znc/tasks/main.yml b/roles/znc/tasks/main.yml index 084fa310..1744f8d3 100644 --- a/roles/znc/tasks/main.yml +++ b/roles/znc/tasks/main.yml @@ -15,7 +15,6 @@ volumes: - "{{ znc_data_directory }}:/znc-data:rw" - "/etc/timezone:/etc/timezone:ro" - network_mode: "bridge" ports: - "{{ znc_port }}:6677" env: From f97dbf5f41dc996e1a660c7769a6c7741cd21417 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:18:26 +0000 Subject: [PATCH 11/15] Update main.yml --- roles/mymediaforalexa/defaults/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/mymediaforalexa/defaults/main.yml b/roles/mymediaforalexa/defaults/main.yml index f4ca0800..048b4010 100644 --- a/roles/mymediaforalexa/defaults/main.yml +++ b/roles/mymediaforalexa/defaults/main.yml @@ -1,6 +1,7 @@ --- # enable or disable the application mymediaforalexa_enabled: false + # directories mymediaforalexa_media_directory: "{{ music_root }}" mymediaforalexa_data_directory: "{{ docker_home }}/mymediaforalexa" From 06adce6fc2e539a8d3c834b25d910c44941a77c0 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:23:05 +0000 Subject: [PATCH 12/15] Update main.yml --- roles/mymediaforalexa/tasks/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/mymediaforalexa/tasks/main.yml b/roles/mymediaforalexa/tasks/main.yml index a896a034..57ee1d19 100644 --- a/roles/mymediaforalexa/tasks/main.yml +++ b/roles/mymediaforalexa/tasks/main.yml @@ -3,7 +3,6 @@ file: path: "{{ item }}" state: directory - # mode: 0755 with_items: - "{{ mymediaforalexa_media_directory }}" - "{{ mymediaforalexa_data_directory }}" @@ -16,6 +15,6 @@ volumes: - "{{ mymediaforalexa_media_directory }}:/medialibrary:rw" - "{{ mymediaforalexa_data_directory }}:/datadir:rw" - network_mode: "host" + network_mode: host restart_policy: unless-stopped memory: "{{ mymediaforalexa_memory }}" From 10e59ae053953b9eba0f29f38dea3d1db37ad947 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:47:18 +0000 Subject: [PATCH 13/15] Update main.yml --- roles/cloudcmd/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/cloudcmd/tasks/main.yml b/roles/cloudcmd/tasks/main.yml index 5ce840ca..eced6def 100644 --- a/roles/cloudcmd/tasks/main.yml +++ b/roles/cloudcmd/tasks/main.yml @@ -3,7 +3,6 @@ file: path: "{{ item }}" state: directory - # mode: 0755 with_items: - "{{ cloudcmd_data_directory }}" @@ -15,7 +14,6 @@ volumes: - "{{ cloudcmd_data_directory }}:/config:rw" - "{{ cloudcmd_browse_directory }}:/mnt/fs" - network_mode: "bridge" ports: - "{{ cloudcmd_port }}:8000" env: From e0aca1edc7bcde221884d8638d176c7a2e54d27b Mon Sep 17 00:00:00 2001 From: David Stephens Date: Tue, 9 Feb 2021 22:54:02 +0000 Subject: [PATCH 14/15] Update main.yml --- roles/firefly/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/roles/firefly/tasks/main.yml b/roles/firefly/tasks/main.yml index 0a8843e5..fb9f4843 100644 --- a/roles/firefly/tasks/main.yml +++ b/roles/firefly/tasks/main.yml @@ -3,7 +3,6 @@ file: path: "{{ item }}" state: directory - # mode: 0755 with_items: - "{{ firefly_data_directory }}/postgresql" - "{{ firefly_data_directory }}/mysql" @@ -39,7 +38,6 @@ - "{{ firefly_data_directory }}/upload:/var/www/firefly-iii/storage/upload:rw" links: - firefly-mysql:db - network_mode: "bridge" ports: - "{{ firefly_port }}:8080" env: From 51436bff56516b4323be1bc9fe63ddc9084dc33d Mon Sep 17 00:00:00 2001 From: Dave Stephens Date: Wed, 10 Feb 2021 00:49:59 +0000 Subject: [PATCH 15/15] Fix Travis build --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f272a8c..5514ca1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,21 @@ --- +dist: focal language: python services: docker env: - playbook: nas.yml - distro: ubuntu1804 + distro: ubuntu2004 test_syntax: true test_playbook: false test_idempotence: false +before_install: + - sudo apt-get -y install ansible + install: + - sudo apt install ansible - pip install ansible-lint - pip install mkdocs - pip install mkdocs-material