Closed geerlingguy closed 9 years ago
I'm adding a new leds
role that will add scripts like rgb
, colors
, and fade
to the user's path (in /usr/bin
, so they can be run as normal commands.
I'm also adding a cron job at system boot to turn on the green LED so the rack looks like it's 'ready to rock and roll!'.
Examples:
# Switch all Pi LEDs to 'green', then 'blue'.
ansible -i inventory all -a "rgb green" -s
ansible -i inventory all -a "rgb blue" -s
# Fade all Pi LEDs.
ansible -i inventory all -a "fade" -s
It's even more fun if you play around with the forks
parameter in /etc/ansible/ansible.cfg
, for example:
[defaults]
forks = 2
You now have a nice visual indication of which Pis are getting hit by Ansible when if you run the above color-changing commands. Change forks to 1, 2, 5, 10, etc. and watch how quickly the command is run on all the Pis. Very helpful in illustrating how quickly Ansible can run things on all your servers, if need be, or how Ansible can operate on batches using serial
and max_fail_percentage
, etc.
See complete writeup in the Wiki:
https://github.com/geerlingguy/raspberry-pi-dramble/wiki/RGB-LEDs-controlled-via-GPIO
I would like to add a separate python script that accepts a few simple arguments and is run on startup (maybe via init script).
Also, maybe have 'drupal' for drupal blue as a demo for doing serial vs. clustered deployment.