Work on media deployments

This commit is contained in:
Ryan Goodwin 2022-06-07 09:43:09 -04:00
parent 32191a1b50
commit b6a2668e33
17 changed files with 333 additions and 141 deletions

View File

@ -12,6 +12,7 @@ Media Server
* 4 core * 4 core
* 8GB RAM * 8GB RAM
* NVIDIA GPU * NVIDIA GPU
* network storage for media
* Applications * Applications
* Plex * Plex
@ -20,7 +21,8 @@ Media Management (Docker)
* Requirements * Requirements
* 4 core * 4 core
* 4GB RAM * 4GB RAM
* nework storage for downloads * network storage for downloads
* network storage from media
* Applications * Applications
* FileBrowser * FileBrowser
@ -28,7 +30,7 @@ Media Management (Docker)
* Radarr (x2) * Radarr (x2)
* Prowlarr * Prowlarr
* Overseerr * Overseerr
* Doplarr * Requestrr
* dizquetv * dizquetv
* Transmission? * Transmission?
@ -36,11 +38,14 @@ Media Management (Docker)
Development Server (Docker) - Server for my code development Development Server (Docker) - Server for my code development
* Requirements * Requirements
* 8 cores
* 8GB RAM
* Applications * Applications
* VSCode Server? * VSCode Server?
* Gitea * Gitea
* Jenkins * Jenkins
* Bookstack
## Home Applications ## Home Applications
@ -66,6 +71,5 @@ Production (Docker) - Important Services
* PiHole * PiHole
* Nginx Proxy Manager * Nginx Proxy Manager
* Uptime Kuma * Uptime Kuma
* Bookstack
--- ---

11
ansible/ansible.cfg Normal file
View File

@ -0,0 +1,11 @@
[defaults]
inventory=hosts
host_key_checking = False
deprication_warnings = False
remote_user = ubuntu
private_key_file = ~/.ssh/id_ed25519
vault_password_file = ./vault-pass.sh

View File

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -1,36 +1,19 @@
galaxy_info: galaxy_info:
author: your name author: Ryan Goodwin
description: your role description description: Install prereqs for docker containers
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: MIT license: MIT
min_ansible_version: "2.1" 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. # 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'. # If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit: # To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/ # https://galaxy.ansible.com/api/v1/platforms/
#
platforms: platforms:
- name: Ubuntu - name: Ubuntu
versions: versions:
- "focal" - focal
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # List tags for your role here, one per line. A tag is a keyword that describes

View File

@ -1,27 +1,34 @@
--- ---
# Portainer (Docker container management GUI) # Installs Portainer or portainer agent for Docker management
- name: Create Portainer volume
community.docker.docker_volume:
name: portainer-data
- name: Deploy Portainer - name: Deploy Portainer
community.docker.docker_container: community.docker.docker_container:
name: portainer name: portainer
image: docker.io/portainer/portainer-ce image: portainer/portainer-ce
ports: restart_policy: always
- "8000:8000"
- "9443:9443"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- portainer-data:/data - portainer_data:/data
restart_policy: always ports:
- 9000:9000
- 8000:8000
when: "'docker-main' in group_names"
# Watchtower (Docker container updater) - name: Deploy Portainer Agent
community.docker.docker_container:
name: portainer-agent
image: portainer/agent
restart_policy: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
when: "'docker-main' not in group_names"
# Install Watchtower to auto update containers. Checks every 4 hours
- name: Deploy Watchtower - name: Deploy Watchtower
community.docker.docker_container: community.docker.docker_container:
name: watchtower name: watchtower
image: containrrr/watchtower image: containrrr/watchtower
command: --schedule "0 0 4 * * *" --debug restart_policy: always
command: --schedule "0 0 4 * * *"
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
restart_policy: always

View File

@ -18,16 +18,16 @@
apt_repository: apt_repository:
repo: deb https://download.docker.com/linux/ubuntu focal stable repo: deb https://download.docker.com/linux/ubuntu focal stable
- name: Install docker - name: Install Docker
apt: apt:
name: name:
- docker-ce - docker-ce
- docker-ce-cli - docker-ce-cli
- container.io - containerd.io
update_cache: yes update_cache: yes
- name: Add user permissions - name: Ddd user permissions
shell: "usermod -aG docker {{ lookup('env','USER') }}" shell: "usermod -aG docker {{ lookup ('env', 'USER') }}"
# Python Docker SDK # Python Docker SDK
- name: Install Python package manager - name: Install Python package manager

View File

@ -1,29 +0,0 @@
---
language: python
python: "2.7"
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
install:
# Install ansible
- pip install ansible
# Check ansible version
- ansible --version
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

View File

@ -1,43 +1,19 @@
galaxy_info: galaxy_info:
author: your name author: Ryan Goodwin
description: your role description description: Deploy containers to manage media collection
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the license: MIT
# 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: min_ansible_version: "2.1"
# - 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. # 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'. # If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit: # To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/ # https://galaxy.ansible.com/api/v1/platforms/
# platforms:
# platforms: - name: Ubuntu
# - name: Fedora versions:
# versions: - focal
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # List tags for your role here, one per line. A tag is a keyword that describes

View File

@ -1,2 +1,196 @@
--- ---
# tasks file for media-manager # Docker Network
- name: Create media network
community.docker.docker_network:
name: media
# Torrent Client
- name: Deploy Transmission
community.docker.docker_container:
name: transmission
image: haugene/transmission-openvpn
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "OPENVPN_PROVIDER: PIA"
- "OPENVPN_CONFIG: ca_toronto"
- "OPENVPN_USERNAME: {{ PIA_USER }}"
- "OPENVPN_PASSWORD: {{ PIA_PASS }}"
- "LOCAL_NETWORK: 192.168.0.0/24"
volumes:
- "{{ CONFIG_FOLDER }}/transmission/data:/data"
capabilities:
- NET_ADMIN
# File Browser
- name: Deploy FileBrowser
community.docker.docker_container:
name: filebrowser
image: filebrowser/filebrowser
restart_policy: unless-stopped
env:
- PUID={{ PUID }}
- PGID={{ PGID }}
volumes:
- "{{ MEDIA_FOLDER }}:/srv"
- "{{ CONFIG_FOLDER }}/filebrowser/filebrowser.db:/database.db"
ports:
- 8080:80
# Index Handler
- name: Deploy Prowlarr
community.docker.docker_container:
name: prowlarr
image: lscr.io/linuxserver/prowlarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/prowlarr/config:/config"
ports:
- 9696:9696
# TV Show Manager
- name: Deploy Sonarr
community.docker.docker_container:
name: sonarr
image: lscr.io/linuxserver/sonarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/sonarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ TV_FOLDER }}:/tv"
- "{{ TV_ANIME_FOLDER }}:/tv-anime"
ports:
- 8989:8989
- name: Deploy Sonarr 4k
community.docker.docker_container:
name: sonarr4k
image: lscr.io/linuxserver/sonarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/sonarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ TV_4K_FOLDER }}:/tv"
ports:
- 9898:8989
# Movie Manager
- name: Deploy Radarr
community.docker.docker_container:
name: radarr
image: lscr.io/linuxserver/radarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/radarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ MOVIE_FOLDER }}:/movie"
- "{{ MOVIE_ANIME_FOLDER }}:/movie-anime"
ports:
- 7878:7878
- name: Deploy Radarr
community.docker.docker_container:
name: radarr
image: lscr.io/linuxserver/radarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/radarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ MOVIE_FOLDER }}:/movie"
- "{{ MOVIE_ANIME_FOLDER }}:/movie-anime"
ports:
- 8787:7878
- name: Deploy Radarr 4k
community.docker.docker_container:
name: radarr
image: lscr.io/linuxserver/radarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/radarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ MOVIE_4k_FOLDER }}:/movie"
ports:
- 8787:7878
# Music Manager
- name: Deploy Lidarr
community.docker.docker_container:
name: lidarr
image: lscr.io/linuxserver/lidarr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
volumes:
- "{{ CONFIG_FOLDER }}/lidarr/config:/config"
- "{{ DOWNLOAD_FOLDER }}:/downloads"
- "{{ MUSIC_FOLDER }}:/music"
ports:
- 8686:8686
# Media Requests
- name: Deploy Overseerr
community.docker.docker_container:
name: overseerr
image: lscr.io/linuxserver/overseerr
restart_policy: unless-stopped
env:
- "TZ={{ TZ }}"
- "PUID={{ PUID }}"
- "PGID={{ PGID }}"
- "LOG_LEVEL=INFO"
volumes:
- "{{ CONFIG_FOLDER }}/overseerr/config:/config"
ports:
- 5055:5055
# - name: Deploy Doplarr
# community.docker.docker_container:
# name: doplarr
# image: lscr.io/linuxserver/doplarr
# restart_policy: unless-stopped
# env:
# - "TZ={{ TZ }}"
# - "PUID={{ PUID }}"
# - "PGID={{ PGID }}"
# - "DISCORD__TOKEN={{ DISCORD_TOKEN }}"
# - "OVERSEERR_API={{ OVERSEERR_API }}"
# Custom TV Channels
- name: Deploy disquetv
community.docker.docker_container:
name: disquetv
image: vexorian/dizquetv
restart_policy: unless-stopped
volumes:
- dizquetv-data:/home/node/app/.dizquetv
ports:
- 32500:8000

View File

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

View File

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

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 media

View File

@ -0,0 +1,2 @@
---
# handlers file for media

View File

@ -0,0 +1,28 @@
galaxy_info:
author: Ryan Goodwin
description: Deploy container for media server
license: MIT
min_ansible_version: "2.1"
# 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: Ubuntu
versions:
- focal
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,10 @@
---
- name: Deploy Plex
community.docker.docker_container:
- name: plex
- image: lscr.io/linuxserver/plex
- restart_policy: unless-stopped
- volumes:
- "{{ CONFIG_FOLDER }}/plex/config:/config"
- "{{ MEDIA_FOLDER }}:/content"

View File

@ -0,0 +1,2 @@
---
# vars file for media