ansible-raspbian
Install and configuration for a Raspberry Pi running Raspbian using Ansible
Setup
- Fresh install of lastest Raspbian on SSD
- Fire up Raspberry Pi and enable SSH
sudo raspi-config
- Change the Raspberry Pi SSH password to something other than the default
raspberry
passwd
- Grab the IP address of your Pi on the network
hostname -I
- Install Ansible and Git on control machine
brew install ansible git brew install http://git.io/sshpass.rb
- Clone this repo to your control machine
git clone git@github.com:devert/ansible-raspbian.git cd ansible-raspbian
- Copy the hosts file and replace
<IP_ADDRESS>
with the IP of your Pi and<SSH_PASSWORD>
to what you changed it to earliercp templates/hosts.example hosts
- Install project dependent roles with Ansible Galaxy
ansible-galaxy install -r requirements.yml
- Run the playbook
ansible-playbook playbook.yml -i hosts
VNC Setup
-
sudo raspi-config
> Interface Options > VNC > Enable. Reboot. -
Generate the password you wish to use for VNC sessions with
vncpasswd -print
vncpasswd -print Password: Verify: Password=40cca9718ffb8e91d55cf290c3db86d5
-
Copy the output of that command (eg.
Password=40cca9718ffb8e91d55cf290c3db86d5
) for the config file. -
Create and edit the following file here:
/etc/vnc/config.d/common.custom
. Enter the following config:Encryption=PreferOn Authentication=VncAuth Password=40cca9718ffb8e91d55cf290c3db86d5
-
Restart the vnc service:
sudo systemctl restart vncserver-x11-serviced
-
In OSX Finder
Go > Connect to Server
and enter addressvnc://pi@<IP_ADDRESS>:5900
. Use the password you provided tovncpasswd
to login.
Plex Setup
-
Update and upgrade everything
sudo apt-get update sudo apt-get upgrade
-
Ensure you have the HTTPs transport package
sudo apt-get install apt-transport-https
-
Add the dev2day repository to your package source list.
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add - echo "deb https://dev2day.de/pms/ stretch main" | sudo tee /etc/apt/sources.list.d/pms.list
-
Update the package list again.
sudo apt-get update
-
Install Plex Service Installer
sudo apt-get install -t stretch plexmediaserver-installer
-
Change some permissions
# Change to PLEX_MEDIA_SERVER_USER=pi sudo nano /etc/default/plexmediaserver.prev # Change ownership of /var/lib/plexmediaserver if necessary chown -R plex:plex /var/lib/plexmediaserver # Restart plexmediaserver sudo service plexmediaserver restart sudo service plexmediaserver status
-
Ensure Pi has a static IP
hostname -I # Add ip=<IP_ADDRESS> to the bottom of this file sudo nano /boot/cmdline.txt
-
Reboot with
sudo reboot
-
Go to
localhost:32400/web
or<IP_ADDRESS>:32400/web
to setup Plex Media Server