Ansible playbook for setting up Raspberry Pi as media server with Plex Media Server and PlexConnect so that it can be connected with Apple TV (2nd generation).
Ansible roles and their features:
- raspbian
- Disable GUI at boot time
- Update APT, upgrade all packages (tag:
upgrade_packages) - Update hostname
- Add ansible to sudoers
- Set static IP address
- vim
- Install Vim
- Use
.vimrcwith sensible defaults
- htop
- Install htop
- win2utf8
- Install
win2utf8(iconvwrapper for converting Cp1250-encoded subtitles to UTF-8)
- Install
- plexmediaserver
- Install latest Plex Media Server for Raspberry Pi
- Configure PMS to use
piuser instead ofplex - Install csfd-plex to get metadata from csfd.cz
- plexconnect
- Install PlexConnect
- Generate certificate
- Set up PlexConnect as service for automatic startup
- Install Ansible on the computer which you want to control your Raspberry Pi from (the host computer)
- Install Git on the host computer
- Install Raspbian on the Raspberry Pi you want to set up
- Set up SSH on the Raspberry Pi you want to set up
- Clone this repository to the host computer
git clone https://github.com/jnsbl/plexpi.git
-
Edit
inventoryinside this directory as necessary -
(optional) Edit
host_vars/plexpi.ymlas necessary -
Run
ansible-playbook main.yml -i inventoryinside this directory to provision everything -
Install PlexConnect certificate to AppleTV
You can filter which part of the provisioning process to run by specifying a set of tags using ansible-playbook's --tags flag. The tags available are raspbian, boot_options, upgrade_packages, vim, htop, win2utf8, plexmediaserver and plexconnect.
ansible-playbook main.yml -i inventory --tags "plexmediaserver,plexconnect"
You can run the playbook and see what changes would be done without actually changing anything.
ansible-playbook main.yml -i inventory --check --diff
The following links helped me to build the playbook: