Configurations for the ansible deployment of braidstag.
We define 3 types of host, a gun, a gateway, and a gameserver. We aren't using DHCP yet, all devices are assigned ip addresses statically.
- flash an sd card with a fresh rasbian-lite image
- Add a blank file called
sshto the boot partition - Plug into ethernet
- Note its ip address.
- set the hostname as per the example below
- ensure that hostname is present in the inventory (
live.hostsfile) - run the meshtag playbook as per the example below
Set the hostname for 192.168.0.151 (interactively)
ansible-playbook -i 192.168.0.151, hostname.yml --extra-vars "ansible_user=pi ansible_password=raspberry ansible_ssh_extra='-o StrictHostKeyChecking=no'" --become
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i 192.168.0.151, hostname.yml --extra-vars "ansible_user=pi ansible_password=raspberry" --become
Meshtag setup
ansible-playbook -i live.hosts meshtag.yml
Meshtag setup for a single host
ansible-playbook -i live.hosts meshtag.yml -l gun1
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i live.hosts meshtag.yml -l meshcontrol -e @andrewVars.yml
Shutdown all machines
ansible -i live.hosts all -a "/sbin/shutdown" --become
Flash all guns (or run any role on any group or host)
ansible -i live.hosts guns -m include_role -a name=flash
Setup your network such that 192.168.0.0/24 is routable from other machines on your network and 192.168.0.128/25 is not DHCP
Create a file to store some setup specific variables. The most likely to be needed is external__router which is the ip of your router and all the gateways will use this for all outbound traffic.
You can use this file by passing -e @filename to ansible
As part of development, you will probably want to be able to use commits to the main repo without pushing to github (which means you can git commit --amend until you are happy then push.)
All the devices have the same ssh key installed which means if you can grant them all permission to pull from your development machine.
- Enable access to your machine with the shared key (warning, this is obviously insecure if your machine is ever public!):
cat roles/common/templates/network/id_rsa_meshtag.pub >> ~/.ssh/authorized_keys - add a variable to override the github repo - something like
game_repo: ssh://[email protected]/home/user/Documents/git/arduino-milestag - You can also specify the branch to pull if you aren't committing to master -
game_version: master
AVR Programming arduino diagram arduino breadboard resistors atmega circuit bluetooth guide Atmega328 fust bit guide