How to create custom reusable vps

August 16, 2014 1.8k views

Hi, Im new to root access vps's etc so please bare that in mind.

I'm trying to setup a reusable droplet. I want to be able to spin up droplets with LEMP Stack, Wordpress & Varnish preinstalled. I've done this already using snapshots but the MySQL Password is the same on every droplet. Is there anyway I can get them auto generated so their different on every preset droplet I spin up?

All responses are appreciated

1 comment
  • just a note. The end result once this is setup correctly is planned to be a control panel where I can spin up a Wordpress droplet with everything set, get emailed the ssh login, as well as the PHPMyAdmin, and SFTP details and its ready to go.

1 Answer

Hey Jake - Currently you can't run post droplet creation scripts that I know of. Booting up a snapshot on a new droplet is similar to waking up your computer from sleep mode, it's just a point in time that the machine resumes operations from.

What I'd recommend though is to add that as the last part of your droplet creation from your control panel. You can use a tool like Ansible to generate the login details for you and report them back or have them emailed to you. For the control panel you can issue the API commands to create the droplet and then run the Ansible tasks that you need with ansible-playbook to set the new MySQL login and create a new SFTP login.

Related links:

  • Thanks for your reply, So I'm going to setup my snapshot vps exactly how I want it and then use Ansible to change the login details of MySQL & SFTP. That sounds great. Thanks

Have another answer? Share your knowledge.