Code Monkey home page Code Monkey logo

plex-playbook's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.