Automating rebuild
8 Replies
You have to fire off a number of jobs, monitor their status, etc. So I was wondering if anyone had automated all that via the API.
A workflow like this should work
1) Shutdown the linode
2) Delete all the disks and config profiles
3) Deploy from your stack script
4) Create a swap partition
6) Create a new config profile with the disks from 3 and 4
7) Boot the profile from 6
You can have the stack script mail you when it's complete and issue a reboot to itself and let lassie bring it back up.
You can do all that in only a hand full of bash commands
You generally have to fire these off, get their job ID, and poll until the job is complete before moving on to the next one. Not rocket science, but not trivial either.
Still interested if anyone has a sample script, but if not, this makes it a lot more straightforward.
I think the business about Job IDs still makes it a non-trivial exercise though, as a script needs to notify if things are failing.