Possible to deploy linode using image from a stackscript?
Thanks
3 Replies
If this is not possible and you really need to use an image that you prepared, maybe this would work: Create three disks:
/dev/xvda minimalroot
/dev/xvdb swap
/dev/xvdc newroot
Then you can deploy a system to /dev/xvda and write a stackscript which formats /dev/xvdc, retrieves a suitable tar.gz that you have prepared, and unpacks it in /dev/xvdc. Then you can change the build profile so that it boots from /dev/xvdc, or you could use pv-grub and modify the menu so that it boots to /dev/xvdc the next time.
I didnt want to use a stackscript because its installing everything from scratch it takes AGES, whereas restoring an image takes a few minutes. I am thinking of keeping a bash script on the image server that has the commands I want to run and then just manually running that after first boot. There is probably a way I could set it run this script automatically on first boot anyway, although I will occasionally deploy this image to run updates to create a new image, so just need to remember to set it back to run this script again the next time it boots.
Thanks
@reboot root /path/to/script
The @reboot will cause the job to be run whenever cron is started (doesn't necessarily have to be a reboot of the machine). Depending on what the script does, you might need to put in some logic so it doesn't get run more than once (e.g., it could delete the entry from /etc/cron.d/ when its tasks have completed successfully).