diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 537331b..d02ef9a 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -231,6 +231,7 @@ plex_port: "32400" plex_config: "{{docker_data_dir}}/plex/config" plex_tv: "/media/series" plex_movies: "/media/movies" +plex_music: "/media/songs" # # WireGuard @@ -243,6 +244,45 @@ wg_deps: "wireguard" wg_ip: "192.168.200.2" wg_pubkey: "+LaPESyBF6Sb1lqkk4UcestFpXNaKYyyX99tkqwLQhU=" -wg_endpoint: "borg.land:51820" +wg_endpoint: "{{ local_domain }}:51820" wg_allowed_ips: "192.168.20.0/24,192.168.200.1/32" wg_dns: "{{ aya01_ip }},{{ pi_ip }},1.1.1.1" + +arr_downloads: "{{ docker_data_dir }}/arr_downloads" +# +# Sonarr +# + +sonarr_port: "8989" +sonarr_host: "sonarr" +sonarr_config: "{{ docker_dir }}/sonarr/config" +sonarr_media: "{{ plex_tv }}" +sonarr_downloads: "{{ arr_downloads }}/sonarr" + +# +# Radarr +# + +radarr_port: "7878" +radarr_host: "radarr" +radarr_config: "{{ docker_dir }}/radarr/config" +radarr_media: "{{ plex_movies }}" +radarr_downloads: "{{ arr_downloads }}/radarr" + +# +# Lidarr +# + +lidarr_port: "8686" +lidarr_host: "lidarr" +lidarr_config: "{{ docker_dir }}/lidarr/config" +lidarr_media: "{{ plex_music }}" +lidarr_downloads: "{{ arr_downloads }}/lidarr" + +# +# Prowlarr +# + +prowlarr_port: "9696" +prowlarr_host: "prowlarr" +prowlarr_config: "{{ docker_dir }}/prowlarr/config" diff --git a/host_vars/pi.yml b/host_vars/pi.yml index a0f0a3d..7494d91 100644 --- a/host_vars/pi.yml +++ b/host_vars/pi.yml @@ -1,5 +1,5 @@ ansible_user: "{{ user }}" ansible_host: 192.168.20.11 ansible_port: 22 -ansible_ssh_private_key_file: /mnt/veracrypt1/genesis +ansible_ssh_private_key_file: /media/veracrypt1/genesis ansible_become_pass: '{{ vault_pi_tudattr_password }}' diff --git a/roles/docker/tasks/aya01_compose.yml b/roles/docker/tasks/aya01_compose.yml index 1598530..9b1d790 100644 --- a/roles/docker/tasks/aya01_compose.yml +++ b/roles/docker/tasks/aya01_compose.yml @@ -32,6 +32,22 @@ tags: - plex +- include_tasks: sonarr.yml + tags: + - sonarr + +- include_tasks: radarr.yml + tags: + - radarr + +- include_tasks: lidarr.yml + tags: + - lidarr + +- include_tasks: prowlarr.yml + tags: + - prowlarr + - name: Copy the compose file template: src: templates/aya01/compose.yaml diff --git a/roles/docker/tasks/lidarr.yml b/roles/docker/tasks/lidarr.yml new file mode 100644 index 0000000..58c0afa --- /dev/null +++ b/roles/docker/tasks/lidarr.yml @@ -0,0 +1,13 @@ +--- +- name: Create lidarr directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ lidarr_config }}" + - "{{ lidarr_media }}" + - "{{ lidarr_downloads }}" diff --git a/roles/docker/tasks/plex.yml b/roles/docker/tasks/plex.yml index d12327d..8ce9ad5 100644 --- a/roles/docker/tasks/plex.yml +++ b/roles/docker/tasks/plex.yml @@ -1,9 +1,22 @@ --- - name: Create plex-config directory file: - path: "{{plex_config}}" - owner: 1000 - group: 1000 + path: "{{ plex_config }}" + owner: "{{ puid }}" + group: "{{ pgid }}" mode: '755' state: directory become: yes + +- name: Create plex media directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ plex_tv }}" + - "{{ plex_movies }}" + - "{{ plex_music }}" diff --git a/roles/docker/tasks/prowlarr.yml b/roles/docker/tasks/prowlarr.yml new file mode 100644 index 0000000..01a2daa --- /dev/null +++ b/roles/docker/tasks/prowlarr.yml @@ -0,0 +1,11 @@ +--- +- name: Create prowlarr directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ prowlarr_config }}" diff --git a/roles/docker/tasks/radarr.yml b/roles/docker/tasks/radarr.yml new file mode 100644 index 0000000..812e3a6 --- /dev/null +++ b/roles/docker/tasks/radarr.yml @@ -0,0 +1,13 @@ +--- +- name: Create radarr directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ radarr_config }}" + - "{{ radarr_media }}" + - "{{ radarr_downloads }}" diff --git a/roles/docker/tasks/sonarr.yml b/roles/docker/tasks/sonarr.yml new file mode 100644 index 0000000..6eeaaee --- /dev/null +++ b/roles/docker/tasks/sonarr.yml @@ -0,0 +1,13 @@ +--- +- name: Create sonarr directories + file: + path: "{{ item }}" + owner: "{{ puid }}" + group: "{{ pgid }}" + mode: '755' + state: directory + become: yes + loop: + - "{{ sonarr_config }}" + - "{{ sonarr_media }}" + - "{{ sonarr_downloads }}" diff --git a/roles/docker/templates/aya01/compose.yaml b/roles/docker/templates/aya01/compose.yaml index 8f451ff..8a90bfb 100644 --- a/roles/docker/templates/aya01/compose.yaml +++ b/roles/docker/templates/aya01/compose.yaml @@ -82,6 +82,9 @@ services: - "{{ pihole_config }}:/etc/pihole/" - "{{ pihole_dnsmasq }}:/etc/dnsmasq.d/" environment: + - PUID={{puid}} + - PGID={{pgid}} + - TZ={{timezone}} - "WEBPASSWORD={{ vault_aya01_pihole_password }}" - "ServerIP={{aya01_ip}}" - "INTERFACE=eth0" @@ -111,8 +114,9 @@ services: volumes: - "{{syncthing_data}}:/var/syncthing" environment: - - "PUID={{ puid }}" - - "PGID={{ pgid }}" + - PUID={{puid}} + - PGID={{pgid}} + - TZ={{timezone}} hostname: syncthing labels: - "traefik.enable=true" @@ -125,6 +129,10 @@ services: restart: unless-stopped networks: - net + environment: + - PUID={{puid}} + - PGID={{pgid}} + - TZ={{timezone}} ports: - 23231:23231 # ssh volumes: @@ -136,6 +144,10 @@ services: restart: unless-stopped networks: - net + environment: + - PUID={{puid}} + - PGID={{pgid}} + - TZ={{timezone}} ports: - "{{cupsd_port}}:631" volumes: @@ -152,6 +164,10 @@ services: restart: always networks: - net + environment: + - PUID={{puid}} + - PGID={{pgid}} + - TZ={{timezone}} ports: - "{{ kuma_port }}:3001" volumes: @@ -181,16 +197,98 @@ services: - PGID={{pgid}} - TZ={{timezone}} - VERSION=docker - - PLEX_CLAIM=claim-wofbDBCEMQT8SxUs1-Rw #optional volumes: - "{{ plex_config }}:/config" - "{{ plex_tv }}:/tv" - "{{ plex_movies }}:/movies" + - "{{ plex_music }}:/music" labels: - "traefik.enable=true" - "traefik.http.routers.{{plex_host}}.rule=Host(`{{ plex_host }}.{{ aya01_host }}.{{local_domain}}`)" - "traefik.http.services.{{plex_host}}.loadbalancer.server.port={{ plex_port }}" + sonarr: + image: lscr.io/linuxserver/sonarr:latest + container_name: sonarr + restart: always + networks: + - net + environment: + - PUID={{ puid }} + - PGID={{ pgid }} + - TZ={{ timezone }} + volumes: + - {{ sonarr_config }}:/config + - {{ sonarr_media }}:/tv #optional + - {{ sonarr_downloads }}:/downloads #optional + ports: + - {{ sonarr_port }}:8989 + labels: + - "traefik.enable=true" + - "traefik.http.routers.{{sonarr_host}}.rule=Host(`{{ sonarr_host }}.{{ aya01_host }}.{{local_domain}}`)" + - "traefik.http.services.{{sonarr_host}}.loadbalancer.server.port={{ sonarr_port }}" + + radarr: + image: lscr.io/linuxserver/radarr:latest + container_name: radarr + restart: always + networks: + - net + environment: + - PUID={{ puid }} + - PGID={{ pgid }} + - TZ={{ timezone }} + volumes: + - {{ radarr_config }}:/config + - {{ radarr_media }}:/movies #optional + - {{ radarr_downloads }}:/downloads #optional + ports: + - {{ radarr_port }}:7878 + labels: + - "traefik.enable=true" + - "traefik.http.routers.{{radarr_host}}.rule=Host(`{{ radarr_host }}.{{ aya01_host }}.{{local_domain}}`)" + - "traefik.http.services.{{radarr_host}}.loadbalancer.server.port={{ radarr_port }}" + + lidarr: + image: lscr.io/linuxserver/lidarr:latest + container_name: lidarr + restart: always + networks: + - net + environment: + - PUID={{ puid }} + - PGID={{ pgid }} + - TZ={{ timezone }} + volumes: + - {{ lidarr_config }}:/config + - {{ lidarr_media }}:/music #optional + - {{ lidarr_downloads }}:/downloads #optional + ports: + - {{ lidarr_port }}:8686 + labels: + - "traefik.enable=true" + - "traefik.http.routers.{{lidarr_host}}.rule=Host(`{{ lidarr_host }}.{{ aya01_host }}.{{local_domain}}`)" + - "traefik.http.services.{{lidarr_host}}.loadbalancer.server.port={{ lidarr_port }}" + + prowlarr: + image: lscr.io/linuxserver/prowlarr:latest + container_name: prowlarr + restart: always + networks: + - net + environment: + - PUID={{ puid }} + - PGID={{ pgid }} + - TZ={{ timezone }} + volumes: + - {{ prowlarr_config }}:/config + ports: + - {{ prowlarr_port }}:9696 + labels: + - "traefik.enable=true" + - "traefik.http.routers.{{prowlarr_host}}.rule=Host(`{{ prowlarr_host }}.{{ aya01_host }}.{{local_domain}}`)" + - "traefik.http.services.{{prowlarr_host}}.loadbalancer.server.port={{ prowlarr_port }}" + networks: zoneminder: driver: bridge