From 88604efebbf8f6ff0eba700a68ed1a4cb884527b Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Fri, 5 Feb 2021 22:33:05 -0900 Subject: [PATCH 1/9] 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 2/9] 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 8067631cb0672b16ca0f4431e0e0993847f8c20f Mon Sep 17 00:00:00 2001 From: PurpleNinja225 Date: Sun, 7 Feb 2021 13:55:49 -0900 Subject: [PATCH 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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: