digitalocean-droplet-manager is a Python command-line interface for automated creation and destruction of DigitalOcean droplets.
In order for this program to function, fully, a domain should be pre-created
for this droplet. This only needs to be done once. Then, delete the A record
associated with it before using create
. This will hopefully be streamlined in
the future if I bother to continue working on this.
To run digitalocean-droplet-manager, simply download and install the requirements via pip:
pip install -r requirements.txt
Once this is done, domanager.py
can be run. It currently has two commands,
create
and destroy
. Both of these take a single argument, which is a
configuration file to use. A sample configuration file is provided as
sample.cfg
. Before it will work, a DigitalOcean API token must be inserted
into the file.
To create a droplet based on the configuration:
python domanager.py create something.cfg
To destroy the droplet:
python domanager.py destroy something.cfg
DigitalOcean charges for droplets by the hour. I wanted an easy way to tear down and restore images, but there were a few problems with snapshots:
- The IP changes every time the box resumes, so the domain name would fail.
- ssh keys weren't automatically added back
- Restoration required the web UI and more than one click (I'm lazy)
Thus, to solve this problem, you can use this tool, create a single specification, then create/destroy whenever you want, conveniently, with the same commands.
TBD
TBD
TBD
Still working out the kinks, and uploaded to GitHub as a backup mechanism. Not looking for feedback or issues yet!
MIT License. See LICENSE.