Skip to content

Commit

Permalink
Add BookSonic, Lidarr and Readerr, remove YouTransfer
Browse files Browse the repository at this point in the history
  • Loading branch information
notthebee committed Dec 13, 2021
1 parent 8e87bbe commit ab4a1dc
Show file tree
Hide file tree
Showing 21 changed files with 264 additions and 45 deletions.
49 changes: 37 additions & 12 deletions group_vars/all/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,55 +91,79 @@ security_autoupdate_mail_on_error: true
#
# Enable/disable individual Docker containers
#

# Home automation

enable_deconz: true

enable_homeassistant: true

# Media

enable_plex: false

enable_jellyfin: true

enable_unifi: false
enable_photoprism: true

enable_authelia: true
enable_booksonic: true

# Yo-ho-ho

enable_deluge: true

enable_sonarr: true

enable_radarr: true

enable_lidarr: false

enable_readarr: false

enable_openbooks: true


enable_jackett: true

enable_deluge: true
# Public-facing services

enable_nextcloud: true

enable_bitwarden: true

enable_photoprism: true
enable_youtransfer: false

enable_swag: true

# DDNS

enable_duckdns: false

enable_cloudflare-ddns: true

enable_youtransfer: true
enable_ddclient: true

enable_piped: false
# VPN

enable_ddclient: true
enable_wireguard: true

enable_ikev2: true

# Homepages

enable_homer: true

enable_flame: false

enable_nextcloud: true
# Misc

enable_swag: true
enable_unifi: false

enable_pihole: true
enable_authelia: true

enable_wireguard: true
enable_piped: false

enable_ikev2: true
enable_pihole: true

enable_watchtower: true

Expand Down Expand Up @@ -236,6 +260,7 @@ mergerfs_root: /mnt/storage
disks:
- { path: /mnt/data1, src: /dev/disk/by-label/Data1, content: true }
- { path: /mnt/data2, src: /dev/disk/by-label/Data2, content: true }
- { path: /mnt/data3, src: /dev/disk/by-label/Data3, content: true }

cache_disks:
- { path: /mnt/cache1, src: /dev/disk/by-label/Cache1, content: true }
Expand Down
6 changes: 6 additions & 0 deletions roles/containers/booksonic/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
container_name: booksonic

dashboard_url: "http://booksonic.box"

homer_category: media
30 changes: 30 additions & 0 deletions roles/containers/booksonic/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
- name: Make sure the {{ container_name }} container is created and running
docker_container:
name: "{{ container_name }}"
image: "ghcr.io/linuxserver/{{ container_name }}"
pull: yes
labels:
"flame.type": "application"
"flame.name": "{{ container_name | title }}"
"flame.url": "{{ dashboard_url }}"
"flame.icon": "custom"
state: 'started'
env:
"PUID": "{{ guid }}"
"PGID": "{{ guid }}"
"TZ": "{{ timezone }}"
volumes:
- "/etc/localtime:/etc/localtime"
- "{{ docker_dir }}/{{ container_name }}:/config"
- "{{ mergerfs_root }}/Media/Audiobooks:/audiobooks"
- "{{ mergerfs_root }}/Media/Podcasts:/podcasts"
restart_policy: unless-stopped

- name: Add {{ container_name }} to the SWAG network (reverse-proxy)
docker_network:
name: swag_network
connected:
- "{{ container_name }}"
appends: yes
when: enable_swag
4 changes: 2 additions & 2 deletions roles/containers/ikev2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
synchronize:
mode: pull
delete: yes
src: "{{ docker_dir }}/{{ container_name }}/config/{{ host }}.mobileconfig"
dest: "~/.ansible/ikev2/{{ host }}.mobileconfig"
src: "{{ docker_dir }}/{{ container_name }}/config/{{ vpn_host }}.mobileconfig"
dest: "~/.ansible/ikev2/{{ vpn_host }}.mobileconfig"
6 changes: 6 additions & 0 deletions roles/containers/lidarr/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
container_name: lidarr

dashboard_url: "http://lidarr.box"

homer_category: media
32 changes: 32 additions & 0 deletions roles/containers/lidarr/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
- name: Make sure the {{ container_name }} container is created and running
docker_container:
name: "{{ container_name }}"
image: "ghcr.io/linuxserver/lidarr"
pull: yes
labels:
"flame.type": "application"
"flame.name": "{{ container_name | title }}"
"flame.url": "{{ dashboard_url }}"
"flame.icon": "custom"
state: 'started'
env:
"PUID": "{{ guid }}"
"PGID": "{{ guid }}"
"TZ": "{{ timezone }}"
volumes:
- "/etc/localtime:/etc/localtime"
- "{{ docker_dir }}/{{ container_name }}:/config"
- "{{ mergerfs_root }}/Media/Music:/music"
- "{{ mergerfs_root }}/Downloads:/downloads"
restart_policy: unless-stopped
ports:
- 8686:8686

- name: Add {{ container_name }} to the SWAG network (reverse-proxy)
docker_network:
name: swag_network
connected:
- "{{ container_name }}"
appends: yes
when: enable_swag
2 changes: 0 additions & 2 deletions roles/containers/openbooks/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"flame.name": "{{ dashboard_name }}"
"flame.url": "{{ dashboard_url }}"
"flame.icon": "custom"
volumes:
- "{{ mergerfs_root }}/Downloads/Books:/books"
env:
"TZ": "{{ timezone }}"
restart_policy: unless-stopped
Expand Down
6 changes: 6 additions & 0 deletions roles/containers/readarr/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
container_name: readarr

dashboard_url: "http://readarr.box/"

homer_category: media
31 changes: 31 additions & 0 deletions roles/containers/readarr/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
- name: Make sure the {{ container_name }} container is created and running
docker_container:
name: "{{ container_name }}"
image: "ghcr.io/linuxserver/readarr:nightly"
pull: yes
labels:
"flame.type": "application"
"flame.name": "{{ container_name | title }}"
"flame.url": "{{ dashboard_url }}"
"flame.icon": "custom"
state: 'started'
env:
"PUID": "{{ guid }}"
"PGID": "{{ guid }}"
"TZ": "{{ timezone }}"
volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ docker_dir }}/{{ container_name }}:/config"
- "{{ mergerfs_root }}/Media/Books:/books"
- "{{ mergerfs_root }}/Media/Audiobooks:/audiobooks"
- "{{ mergerfs_root }}/Downloads:/downloads"
restart_policy: unless-stopped

- name: Add {{ container_name }} to the SWAG network (reverse-proxy)
docker_network:
name: swag_network
connected:
- "{{ container_name }}"
appends: yes
when: enable_swag
2 changes: 2 additions & 0 deletions roles/containers/sonarr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- "{{ mergerfs_root }}/Media/TV:/tv"
- "{{ mergerfs_root }}/Downloads:/downloads"
restart_policy: unless-stopped
ports:
- 8989:8989

- name: Add {{ container_name }} to the SWAG network (reverse-proxy)
docker_network:
Expand Down
26 changes: 25 additions & 1 deletion roles/containers/swag/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,33 @@
template:
src: "{{ item }}"
dest: "{{ docker_dir }}/{{ container_name }}/config/nginx/proxy-confs/{{ item | basename | regex_replace('.j2$', '') }}"
when: lookup('vars', 'enable_' + (item | basename).split('.')[0]) | default(False)
with_fileglob:
- templates/*.j2
register: swag_config

- name: Create a list of variables files that were deployed
set_fact:
installed_templates: "{{installed_templates | default([]) + [ item.dest ]}}"
with_items: "{{ swag_config.results }}"
when: item.skipped is not defined

- name: List all config files in the target folder
find:
path: "{{ docker_dir }}/{{ container_name }}/config/nginx/proxy-confs/"
patterns:
- ".*\\.conf(?!\\.sample)"
use_regex: yes
register: found_files

- name: Remove config files for disabled services
file:
path: "{{ item.path }}"
state: absent
when: item.path not in installed_templates
with_items: "{{ found_files['files'] }}"
register: removed_swag_config

- name: Install the DNS config file
template:
src: "dns-conf/cloudflare.ini.j2"
Expand All @@ -76,6 +99,7 @@
"EMAIL": "{{ email }}"
ports:
- "443:443"
- "80:80"
volumes:
- "{{ docker_dir }}/{{ container_name }}/config:/config"
restart_policy: unless-stopped
Expand All @@ -92,4 +116,4 @@
state: started
restart: yes
when:
swag_config.changed
swag_config.changed or removed_swag_config.changed
16 changes: 16 additions & 0 deletions roles/containers/swag/templates/booksonic.subdomain.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
{% include "common/internal.j2" %}
{% include "common/params.j2" %}
server_name {{ swag_urls['booksonic'] }};

location / {
{% include "common/cors.j2" %}
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app booksonic;
set $upstream_port 4040;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}
}
26 changes: 26 additions & 0 deletions roles/containers/swag/templates/lidarr.subdomain.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
{% include "common/internal.j2" %}
{% include "common/params.j2" %}
server_name {{ swag_urls['lidarr'] }};

location / {
{% include "common/cors.j2" %}
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app lidarr;
set $upstream_port 8686;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}

location ~ (/lidarr)?/api {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app lidarr;
set $upstream_port 8686;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ server {
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

proxy_max_temp_file_size 2048m;
proxy_max_temp_file_size 100000m;
}
}
26 changes: 26 additions & 0 deletions roles/containers/swag/templates/readarr.subdomain.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
{% include "common/internal.j2" %}
{% include "common/params.j2" %}
server_name {{ swag_urls['readarr'] }};

location / {
{% include "common/cors.j2" %}
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app readarr;
set $upstream_port 8787;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}

location ~ (/readarr)?/api {
include /config/nginx/proxy.conf;
include /config/nginx/resolver.conf;
set $upstream_app readarr;
set $upstream_port 8787;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}
}
Loading

0 comments on commit ab4a1dc

Please sign in to comment.