jonnyparris / plex-playbook

Home NAS / Plex media server setup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VPS Plex ansible playbook

VPS/NAS Plex media server setup.

  • Server setup using ansible
  • Setup docker containers for all services and isolated VPN for transmission
    • Plex: media server
    • Sonarr: series tracker
    • Radarr: movies tracker
    • Jackett: torrent client api
    • Sabnzbd: usenet client
    • Tautulli: plex usage stats
    • Overseer: media request manager
    • Bazarr: subtitles tracker 🚧
    • Rclone: remote/cloud file management 🚧 (maybe)

Customise this fork

  • find + replace jonnyparris with your desired user
  • find + replace duvcloud with your desired server hostname
  • customise your welcome banner ascii art

Setting up ansible

pip install ansible

(or use homebrew: brew install ansible)

Set up the server list to play on

Check inventory after setting up the ansible hosts file in the expected location /etc/ansible/hosts .

(Below it's being symlinked to the file in this repo but you can also just paste the contents there directly.)

sudo mkdir /etc/ansible
sudo ln -s ~/Repos/Notes/duvplex/ansible_hosts.conf /etc/ansible/hosts
ansible-inventory --list -y

# or specify inventory
ansible-inventory -i ansible_hosts.conf --list -y

Test connection

Add public key to the server as root and then test out connection. Also copy that public key to this folder for the playbook to use when it runs.

Tries to ssh as root in this case

ansible all -m ping -u root

Vault to store passwords

file:ansible_vault_password.txt --> vault password file:ansible_vault.yml --> Put passwords here

cd ~/Repos/duvplex/
ansible-vault create ansible_vault.yml
ansible-vault decrypt --vault-password-file=ansible_vault_password.txt ansible_vault.yml
ansible-vault encrypt --vault-password-file=ansible_vault_password.txt ansible_vault.yml

Set VPN password in ansible vault

Set your passwords in a file named ansible_vault.yml:

password: your_super_secure_server_password
OPENVPN_USERNAME: sdsdsijsldijij # service creds if using nord
OPENVPN_PASSWORD: sdopksdpjsdpsijpass # service creds if using nord
PASSWORD_7Z: password used when backing up config files

Execute the playbook

ansible-playbook playbook.yml -i ansible_hosts.conf --vault-pass-file ansible_vault_password.txt
ansible-playbook playbook.yml -i ansible_hosts.conf --vault-pass-file ansible_vault_password.txt --tags backup

Bring the docker containers up manually now that server is setup

Create everything

cd ~/plex
# likely problematic so run it alone to fix it if need be because this container also holds the VPN info
docker-compose up transmission

docker-compose up # run all the services we just set up

# run as background deamon
docker-compose up -d

Web config

You might want to setup your remote IP in your /etc/hosts file (e.g. 165.89.88.177 duvcloud) to save having to remember a random IP address.

Plex ssh tunneling, ssh like this first then the URL below will start to work, once we login in and setup stuff the normal URL above will work

ssh -L32400:localhost:32400 jonnyparris@duvcloud

then head to http://localhost:32400/web to setup Plex

Similarly, you might have to tunnel on port 8080 to setup Sabnzbd.

ssh -L8080:localhost:8080 jonnyparris@duvcloud

then head to http://localhost:32400/web to setup Sabnzbd

Setup dropbox uploader to backup config (optional)

https://github.com/andreafabrizi/Dropbox-Uploader

Run

~/plex/dropbox_uploader.sh

Notes

About

Home NAS / Plex media server setup

License:GNU General Public License v3.0


Languages

Language:Shell 100.0%