diff --git a/group_vars/all.yml b/group_vars/all.yml index 47f7056d..7deac84c 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 @@ -40,7 +37,6 @@ miniflux_enabled: false glances_enabled: false stats_enabled: false guacamole_enabled: false -cloudcmd_enabled: false virtual_desktop_enabled: false krusader_enabled: false @@ -51,7 +47,6 @@ timemachine_enabled: false gitlab_enabled: false # IRC -znc_enabled: false thelounge_enabled: false # Wallabag @@ -59,7 +54,6 @@ wallabag_enabled: false # Home Automation mosquitto_enabled: false -homebridge_enabled: false openhab_enabled: false # Books @@ -288,16 +282,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 ### @@ -323,17 +307,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 ### @@ -385,16 +358,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 ### @@ -425,12 +388,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 7948ab84..3117fdfe 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 @@ -103,12 +108,17 @@ - homeassistant when: (homeassistant_enabled | default(False)) + - role: homebridge + tags: + - homebridge + when: (homebridge_enabled | default(False)) + - role: lidarr tags: - lidarr when: (lidarr_enabled | default(False)) - - role: minidlna + - role: minidlna tags: - minidlna when: (minidlna_enabled | default(False)) @@ -118,6 +128,11 @@ - mylar when: (mylar_enabled | default(False)) + - role: mymediaforalexa + tags: + - mymediaforalexa + when: (mymediaforalexa_enabled | default(False)) + - role: n8n tags: - n8n_enabled @@ -203,6 +218,12 @@ - watchtower when: (watchtower_enabled | default(False)) + - role: znc + tags: + - znc + when: (znc_enabled | default(False)) + + tasks: - import_tasks: tasks/tautulli.yml when: (tautulli_enabled | default(False)) tags: tautulli @@ -219,10 +240,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 @@ -247,10 +264,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 @@ -271,10 +284,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 @@ -287,10 +296,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 80% rename from tasks/cloudcmd.yml rename to roles/cloudcmd/tasks/main.yml index f67936d0..eced6def 100644 --- a/tasks/cloudcmd.yml +++ b/roles/cloudcmd/tasks/main.yml @@ -1,12 +1,12 @@ --- -- name: Create CloudCmd Directories +- name: Create Cloudcmd Directories file: path: "{{ item }}" state: directory with_items: - "{{ cloudcmd_data_directory }}" -- name: CloudCmd +- name: Create Cloudcmd Docker Container docker_container: name: cloudcmd image: coderaiser/cloudcmd @@ -21,11 +21,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" 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 }}" diff --git a/roles/mymediaforalexa/defaults/main.yml b/roles/mymediaforalexa/defaults/main.yml new file mode 100644 index 00000000..048b4010 --- /dev/null +++ b/roles/mymediaforalexa/defaults/main.yml @@ -0,0 +1,10 @@ +--- +# 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 77% rename from tasks/mymediaforalexa.yml rename to roles/mymediaforalexa/tasks/main.yml index 6bddb54e..57ee1d19 100644 --- a/tasks/mymediaforalexa.yml +++ b/roles/mymediaforalexa/tasks/main.yml @@ -1,4 +1,5 @@ -- name: Create mymedia for alexa Directories +--- +- name: Create Mymediaforalexa Directories file: path: "{{ item }}" state: directory @@ -6,7 +7,7 @@ - "{{ mymediaforalexa_media_directory }}" - "{{ mymediaforalexa_data_directory }}" -- name: mymedia for alexa Docker Container +- name: mymediaforalexa Docker Container docker_container: name: mymediaforalexa image: bizmodeller/mymediaforalexa @@ -16,5 +17,4 @@ - "{{ mymediaforalexa_data_directory }}:/datadir:rw" network_mode: host restart_policy: unless-stopped - memory: 1g - + memory: "{{ mymediaforalexa_memory }}" 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 82% rename from tasks/znc.yml rename to roles/znc/tasks/main.yml index 2401b53b..1744f8d3 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 @@ -20,11 +21,11 @@ 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"