All these commands are run from your computer, not the RPi.
# Update inventory with your RPi IP addresses and hostnames
cp ansible/inventory.example ansible/inventory
# Update ansible_user to the user you used when you flashed Ubuntu
cp ansible/vars.example.yml ansible/vars.yml
Note: Prefix with watch command to view realtime
# Check they are connectable
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible \
-i ansible/inventory \
k3s_cluster -m ping
# Check that sudo is not blocked, if this return value is not 0 wait until it is
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible \
all -i ansible/inventory -m shell -a "test /var/lib/dpkg/lock-frontend && echo \$?"
Note: Run this when all RPis are online
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook \
-i ansible/inventory \
ansible/playbook.yml
Note: Run this when all RPis are online
Important: Running this requires a USB drive inserted into each Pi, this playbook will format the ENTIRE flash storage
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible-playbook \
-i ansible/inventory \
ansible/playbook-usbdrive.yml
Note: This should be below 70.0'C for good performance
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible \
all -i ansible/inventory -m shell -a "/opt/vc/bin/vcgencmd measure_temp"
Note: This should be 175000
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible \
all -i ansible/inventory -m shell -a "cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq"
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible -b \
all -i ansible/inventory -m shell -a "/sbin/shutdown -r now"
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible -b \
all -i ansible/inventory -m shell -a "/sbin/shutdown -h now"
# master and workers
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible -b \
all -i ansible/inventory -m shell -a "/usr/local/bin/k3s-killall.sh"
# master
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible -b \
all -i ansible/inventory -m shell -a "/usr/local/bin/k3s-uninstall.sh"
# workers
env ANSIBLE_CONFIG=ansible/ansible.cfg ansible -b \
all -i ansible/inventory -m shell -a "/usr/local/bin/k3s-agent-uninstall.sh"