This commit is contained in:
Martin Eichner
2023-06-27 17:36:56 +02:00
commit 8d5852a4fa
46 changed files with 2330 additions and 0 deletions

38
roles/mediaserver/README.md Executable file
View File

@@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

View File

@@ -0,0 +1,2 @@
---
# defaults file for mediaserver

View File

@@ -0,0 +1,128 @@
appConfig:
theme: material-dark-original
layout: auto
iconSize: medium
language: de
startingView: default
defaultOpeningMethod: newtab
statusCheck: true
statusCheckInterval: 10
faviconApi: faviconkit
routingMode: history
enableMultiTasking: false
webSearch:
disableWebSearch: false
searchEngine: duckduckgo
openingMethod: newtab
searchBangs: {}
enableFontAwesome: true
cssThemes: []
customColors: {}
externalStyleSheet: []
hideComponents:
hideHeading: false
hideNav: false
hideSearch: false
hideSettings: true
hideFooter: false
hideSplashScreen: false
auth:
enableGuestAccess: true
users:
- user: martin
hash: E0B61E6A6E096DCE51E236DF27B32B2D3247F563407F506203355E850F5A6EC2
type: admin
enableKeycloak: false
keycloak: {}
allowConfigEdit: true
enableServiceWorker: false
disableContextMenu: false
disableUpdateChecks: false
disableSmartSort: false
enableErrorReporting: false
pageInfo:
title: Dashy
description: Welcome to your new dashboard!
navLinks:
- title: GitHub
path: https://github.com/Lissy93/dashy
- title: Documentation
path: https://dashy.to/docs
footerText: ''
sections:
- name: Mediaserver
icon: fas fa-rocket
items:
- title: Sonarr
description: TV Series
icon: favicon
url: http://192.168.178.200:8989
target: newtab
id: 0_1143_sonarr
- title: Radarr
description: Movies
url: http://192.168.178.200:7878
icon: favicon
id: 1_1143_radarr
- title: Deluge
description: Torrent
icon: https://deluge-torrent.org/images/deluge-icon.png
url: http://192.168.178.200:8112
id: 2_1143_deluge
- title: prowlarr
icon: favicon
url: http://192.168.178.200:9696
target: newtab
id: 3_1143_prowlarr
- title: sabnzbd
icon: favicon
url: http://192.168.178.200:8080
target: newtab
id: 4_1143_sabnzbd
- title: bazarr
icon: favicon
url: http://192.168.178.200:6767
target: newtab
id: 5_1143_bazarr
- title: Jellyfin
icon: favicon
url: http://192.168.178.200:8096
target: newtab
id: 6_1143_jellyfin
displayData:
sortBy: default
rows: 1
cols: 1
collapsed: false
hideForGuests: false
- name: Adminstuff
displayData:
sortBy: default
rows: 1
cols: 1
collapsed: false
hideForGuests: false
items:
- title: Proxmox
icon: favicon
url: https://192.168.178.210:8006
target: newtab
statusCheckAllowInsecure: 'true'
id: 0_1041_proxmox
- title: TrueNAS
icon: http://192.168.178.201/ui/assets/images/truenas_core_favicon.png
url: http://192.168.178.201/ui/
id: 1_1041_truenas
# - title: Seafile
# icon: https://manual.seafile.com/media/seafile-transparent-1024.png
# url: http://192.168.178.200:8081
# id: 2_1041_seafile
# - title: Django
# icon: favicon
# url: http://192.168.178.200:8000
# id: 3_1041_django
- title: check_mk
icon: >-
http://192.168.178.200:8095/cmk/check_mk/themes/modern-dark/images/tribe29_icon.svg
url: http://192.168.178.200:8095/cmk/check_mk/
id: 4_1041_checkmk

Binary file not shown.

View File

@@ -0,0 +1,9 @@
---
# handlers file for mediaserver
- name: restart docker-compose
community.docker.docker_compose:
project_src: /opt/docker/mediaserver
remove_orphans: true
pull: true
state: present
restarted: true

52
roles/mediaserver/meta/main.yml Executable file
View File

@@ -0,0 +1,52 @@
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@@ -0,0 +1,94 @@
---
- name: Create nfs mounts
become: true
lineinfile:
path: /etc/fstab
line: "{{ item }}"
state: present
loop: "{{ NFS_MOUNTS }}"
tags: setup, test
- name: Add podman repo + gpg key
block:
- name: somerepo |no apt key
ansible.builtin.get_url:
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/Release.key"
dest: /etc/apt/trusted.gpg.d/podman.asc
- name: somerepo | apt source
ansible.builtin.apt_repository:
repo: "deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/podman.asc] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ ansible_distribution_version }}/ /"
state: present
- name: Install mediaserver packages
apt:
name: "{{ item }}"
state: present
update_cache: true
loop:
- python3-docker
- podman
#- podman-plugins
- name: Install pip docker-compose
pip:
name: docker-compose
state: present
- name: Create project dir
file:
state: directory
#mode: '0755'
#owner: 1000
#group: 1000
path: /opt/docker/mediaserver/config/openvpn/unused
recurse: yes
tags: setup
- name: Create sabnzbd conf folder
file:
state: directory
path: /opt/docker/mediaserver/sabnzbd_config/openvpn
recurse: yes
tags: setup
- name: Place ovpn files
unarchive:
src: ovpn.tar.gz
dest: "{{ item }}"
loop:
- /opt/docker/mediaserver/config/openvpn
- /opt/docker/mediaserver/sabnzbd_config/openvpn
changed_when: false
tags: setup, delugevpn
- name: Create dashy config folder
file:
state: directory
path: /opt/docker/mediaserver/dashy_config
tags: setup, dashy
- name: Place dashy config file
copy:
src: dashy_config.yml
dest: /opt/docker/mediaserver/dashy_config/config.yml
notify: restart docker-compose
tags: setup, dashy
- name: Place docker-compose.yaml
template:
src: docker-compose.yaml.j2
dest: /opt/docker/mediaserver/docker-compose.yaml
#owner: 1000
#group: 1000
#mode: '0755'
notify: restart docker-compose
tags: setup
- name: Start mediaserver
community.docker.docker_compose:
project_src: /opt/docker/mediaserver
state: present
pull: true
...

View File

@@ -0,0 +1,192 @@
version: '3.3'
services:
arch-delugevpn:
cap_add:
- NET_ADMIN
ports:
- '8112:8112'
- '8118:8118'
- '58846:58846'
- '58946:58946'
container_name: delugevpn
volumes:
- '/mnt/nfs/martin/deluge/data:/data'
- '/mnt/nfs/martin/Downloads:/downloads'
- './config:/config'
- '/etc/localtime:/etc/localtime:ro'
environment:
- VPN_ENABLED=yes
- VPN_USER={{ VPN_USER }}
- VPN_PASS={{ VPN_PASS }}
- VPN_PROV=pia
- VPN_CLIENT=openvpn
- STRICT_PORT_FORWARD=yes
- ENABLE_PRIVOXY=yes
- LAN_NETWORK=192.168.178.0/24
- NAME_SERVERS=84.200.69.80,37.235.1.174,1.1.1.1,37.235.1.177,84.200.70.40,1.0.0.1
- DELUGE_DAEMON_LOG_LEVEL=info
- DELUGE_WEB_LOG_LEVEL=info
- VPN_INPUT_PORTS=1234
- VPN_OUTPUT_PORTS=5678
- DEBUG=false
- UMASK=000
- PUID=0
- PGID=0
image: binhex/arch-delugevpn:2.1.1-1-01
restart: unless-stopped
arch-sabnzbdvpn:
cap_add:
- NET_ADMIN
ports:
- '8080:8080'
- '8090:8090'
- '8119:8118'
container_name: sabnzbdvpn
volumes:
- '/mnt/nfs/martin/Downloads:/downloads'
- './sabnzbd_config:/config'
- '/etc/localtime:/etc/localtime:ro'
environment:
- VPN_ENABLED=yes
- VPN_USER={{ VPN_USER }}
- VPN_PASS={{ VPN_PASS }}
- VPN_PROV=pia
- VPN_CLIENT=openvpn
- STRICT_PORT_FORWARD=yes
- ENABLE_PRIVOXY=yes
- LAN_NETWORK=192.168.178.0/24
- 'NAME_SERVERS=84.200.69.80,37.235.1.174,1.1.1.1,37.235.1.177,84.200.70.40,1.0.0.1'
- VPN_INPUT_PORTS=1234
- VPN_OUTPUT_PORTS=5678
- DEBUG=false
- UMASK=000
- PUID=0
- PGID=0
image: binhex/arch-sabnzbdvpn:3.6.0-2-01
restart: unless-stopped
sonarr:
image: mdhiggins/sonarr-sma
container_name: sonarr
volumes:
- ./sonarr_config:/config
- ./sma:/usr/local/sma/config
- /mnt/nfs/martin/TV:/tv
- /mnt/nfs/martin/Downloads:/downloads
ports:
- 8989:8989
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
radarr:
image: lscr.io/linuxserver/radarr
container_name: radarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
volumes:
- ./radarr_config:/config
- /mnt/nfs/martin/movies:/movies
- /mnt/nfs/martin/Downloads:/downloads
ports:
- 7878:7878
restart: unless-stopped
dashy:
image: lissy93/dashy
container_name: Dashy
volumes:
- ./dashy_config/config.yml:/app/public/conf.yml
ports:
- 80:80
environment:
- NODE_ENV=production
restart: unless-stopped
healthcheck:
test: ['CMD', 'node', '/app/services/healthcheck']
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
jellyfin:
image: lscr.io/linuxserver/jellyfin
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/London
- JELLYFIN_PublishedServerUrl=192.168.178.200 #optional
volumes:
- ./jelly_config:/config
- /mnt/nfs/martin/TV:/data/tvshows
- /mnt/nfs/martin/movies:/data/movies
- /mnt/nfs/martin/shows:/data/shows
- /mnt/nfs/martin/rips:/data/test
ports:
- 8096:8096
- 8920:8920 #optional
- 7359:7359/udp #optional
- 1900:1900/udp #optional
restart: unless-stopped
flaresolverr:
# DockerHub mirror flaresolverr/flaresolverr:latest
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: flaresolverr
environment:
- LOG_LEVEL=${LOG_LEVEL:-info}
- LOG_HTML=${LOG_HTML:-false}
- CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
- TZ=Europe/London
ports:
- "${PORT:-8191}:8191"
restart: unless-stopped
bazarr:
image: ghcr.io/linuxserver/bazarr
container_name: bazarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- ./bazarr_config:/config
- /mnt/nfs/martin/movies:/movies
- /mnt/nfs/martin/TV:/tv
ports:
- 6767:6767
restart: unless-stopped
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: prowlarr
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
volumes:
- ./prowlar_config:/config
ports:
- 9696:9696
restart: unless-stopped
# readarr:
# image: lscr.io/linuxserver/readarr:develop
# container_name: readarr
# environment:
# - PUID=1000
# - PGID=1000
# - TZ=Europe/Berlin
# volumes:
# - ./config:/config
# - /mnt/nfs/martin/books:/books
# - /mnt/nfs/martin/Downloads:/downloads
# ports:
# - 8787:8787
# restart: unless-stopped
...

View File

@@ -0,0 +1,2 @@
localhost

View File

@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- mediaserver

View File

@@ -0,0 +1,8 @@
---
VPN_USER: "p3754227"
VPN_PASS: "xsZtFdAofY"
NFS_MOUNTS:
- 192.168.178.201:/mnt/main/martin /mnt/nfs/martin nfs defaults 0 0
- 192.168.178.201:/mnt/main/backups /mnt/nfs/backup nfs defaults 0 0
- 192.168.178.201:/mnt/main/martin/transcodes/transcodes /opt/docker/mediaserver/jelly_config/data/transcodes nfs defaults 0 0
...