Skip to content

Commit

Permalink
improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
heisters committed Sep 18, 2015
1 parent 4607af1 commit 6bed442
Showing 1 changed file with 45 additions and 12 deletions.
57 changes: 45 additions & 12 deletions README.md
@@ -1,17 +1,13 @@
ansible-pi: video-cluster
=========================

![](https://raw.github.com/scottmotte/ansible-pi/master/ansible-pi.jpg)

Quickly setup your Raspberry Pi to be part of a synchronized cluster of
video players.

Based on this [complete guide to setting up your raspberry pi without a keyboard and mouse](http://sendgrid.com/blog/complete-guide-set-raspberry-pi-without-keyboard-mouse/).

PI Setup
--------

1. Image your pis. `script/image_card` helps with this.
1. Image your SD cards. `script/image_card` helps with this.
2. Boot the new pis and go through initialization. Expand the
filesystem, enable SSH, and optionally set the hostname to something
unique.
Expand All @@ -24,7 +20,7 @@ Ensure ansible is installed (see Requirements, below).

Clone and setup the ansible script.

git clone https://github.com/heisters/ansible-pi.git
git clone https://github.com/heisters/node-omxplayer-sync-devops.git
cd ansible-pi
git checkout video-cluster
cp hosts.example hosts
Expand All @@ -43,19 +39,40 @@ Optionally, copy your ssh id to the players:

To check that the players are properly configured:

ansible all -m ping -i hosts
script/ping

Provision the players:

ansible-playbook provision.yml -i hosts
script/provision

If you didn't copy your ssh id previously, you'll need to run the
provision command directly with `--ask-pass`:

ansible-playbook provision.yml --ask-pass -i hosts

Provisioning will automatically deploy the application for you. However,
once provisioning is done, you'll need copy your video file and any
custom configuration to the pis:

script/copy <a video file> /home/pi/video.mov

or, if each pi gets a different video file:

scp <video file 1> pi@raspberrypi-1.local:~/video.mov
scp <video file 2> pi@raspberrypi-2.local:~/video.mov
# ...

Then, optionally, copy the configuration:

If you didn't copy your ssh id previously, you'll need to pass
--ask-pass to that command.
script/copy <path>/config.local.js /app/

See https://github.com/heisters/node-omxplayer-sync for more details on
configuration.

Deployment
----------

ansible-playbook deploy.yml -i hosts
script/deploy

Requirements
------------
Expand All @@ -69,4 +86,20 @@ Useful Commands

Run adhoc commands:

ansible -i hosts players -a "<bash command>"
script/run 'ls /'

Same, but with sudo privileges:

script/srun 'halt'

Manage the system service for the video player:

script/service restarted

Copy a local file to all players:

script/copy ../my-local-file.txt /app/

Check whether you can connect to all players:

script/ping

0 comments on commit 6bed442

Please sign in to comment.