An Ansible playbook to provision a Raspberry Pi as a 2-channel relay control server. Both a simple web interface and a REST API is provided to allow for easy control and integration with other systems.
The following instructions assume you are using a Raspberry Pi 3 Model B.
- Follow the Mount SD card in VirtualBox from Mac OS X Host guide to get access to SD Card from VirtualBox running on OS X host.
- Prepare the SD Card by following these instructions on the Arch Linux ARM website.
- Before running
umount boot root
from the above instructions, runsync
. - After running
umount boot root
from the above instructions, shutdown VirtualBox and then Eject the SD Card from OS X. - Insert SD Card into the Pi and boot
- Run
arp -a
and look for the "alarm" entry to find the IP address of the Raspberry Pi.
By default Arch Linux ARM does not allow password authentication for root user over ssh. So, before running the Ansible playbook, you need to ssh with the alarm
user, su root
and add an authorized public key so that Ansible is able to ssh in as root.
ssh alarm@[ip_address]
(password: alarm)su root
(password: root)mkdir ~/.ssh
curl -o ~/.ssh/authorized_keys https://github.com/bradyholt.keys
(replace bradyholt with your GitHub username)reboot
Do the following from the provisioning host (i.e. OS X or Windows):
- Ensure Ansible 2.2 is installed
- Copy config.yml.example to config.yml
- Edit config.yml and update values per your environment
- Run
./provision.sh
- Navigate to http://[ip_address]:3000 and you should see the web interface like below