I have setup too many beaglebone and raspberries for IoT gateways. I did have a nice check list of each step to take, then someone showed me ansible.
So working towards all of that automation.
I don't install ansible on my machine, but instead run it inside a Docker container.
Things go a lot smoother if you have put public keys in place.
ssh-copy-id -i ~/.ssh/id_rsa $NODES
- Build:
docker build -t local/ansible-playbook:latest .
- Run with:
ansible_helper
Currently, if you want to setup a Raspberry Pi without keyboard or monitor do the following:
- Copy image to SD Card
- Mount it
- Add empty file to the SD Card named
ssh
- Add a file named
wpa_supplicant.conf
with the following:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
scan_ssid=1
ssid="$your_wifi_ssid"
psk="$your_wifi_password"
}
- There appears to be support for a
firstuse.sh
script, but it also appears to be undocumented. - Eject SD Card from computer
- Insert to Raspberry PI
- Boot device
- Wait a minute or three
ssh [email protected].
; default passwordsudo raspi-config
- Change hostname and passwords and resize the filesystem
- Reboot
- Press
⌘⇧X
(or⌃⇧X
if not Mac) to access the advanced options. - Check ssh box and WiFi setup and change hostname
- Write image