geerlingguy / beast-challenge

A control system for MrBeast's 1-100 challenge
GNU General Public License v3.0
26 stars 1 forks source link

Automate Le Potato Provisioning (and idempotent restoration of state) #14

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

Finish setting up the Ansible playbook to provision new Le Potato instances, and make sure it is as idempotent as possible so we can run and re-run the playbook during the game, while in production.

I would like to make sure the Python script/app running on the nodes is as robust as possible, so either a Docker container or just a systemd configuration that runs the script and makes sure it stays running would be nice.

Follow-up to #1.

geerlingguy commented 1 year ago

Regarding the codebase—we might need to clone it (or we can copy from the master machine I guess...), and if we do need to, we should use Fine Grained Personal Access Tokens. But we probably won't need that since we can just copy everything from the main machine.

geerlingguy commented 1 year ago

Confirmed with i2c tasks in Ansible that before it runs:

admin@lepotato:~$ i2cdetect -l
i2c-0   i2c         DesignWare HDMI                     I2C adapter

And after it runs (it reboots on the fly if required):

admin@lepotato:~$ i2cdetect -l
i2c-0   i2c         Meson I2C adapter                   I2C adapter
i2c-1   i2c         DesignWare HDMI                     I2C adapter

admin@lepotato:~$ i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --   
geerlingguy commented 1 year ago

Added docs for running ansible-playbook spud-control.yml -k -K -e '{"run_upgrades": true}' to get things going. Done here.