Created
November 26, 2014 19:09
-
-
Save joneskoo/f3688a2e38d27d34dbf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
apt_update: true | |
apt_upgrade: true | |
packages: | |
- augeas-tools | |
- screen | |
- curl | |
- wget | |
- build-essential | |
- git-core | |
- p7zip-full | |
ssh_pwauth: False | |
users: | |
- name: fuzz | |
groups: sudo | |
shell: /bin/bash | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
ssh-authorized-keys: | |
- ssh-rsa ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
HOSTNAME=$1 | |
DOMAIN=do.yx.fi | |
IMAGE="ubuntu-14-04-x64" | |
REGION=lon1 | |
SIZE=512mb | |
SSH_KEY=1b:bb:5c:85:8c:50:7f:eb:43:86:ca:b7:27:67:fc:2a | |
if [[ -z $HOSTNAME ]]; then | |
echo Usage: start-vm HOSTNAME | |
exit 1 | |
fi | |
if [[ -z $DO_API_TOKEN ]]; then | |
echo Set DO_API_TOKEN environment variable first | |
exit 1 | |
fi | |
http -v --json post "https://api.digitalocean.com/v2/droplets" \ | |
Authorization:"Bearer ${DO_API_TOKEN}" \ | |
name=$HOSTNAME.do.yx.fi \ | |
region=$REGION \ | |
size=$SIZE \ | |
[email protected] \ | |
ssh_keys:="[\"$SSH_KEY\"]" \ | |
image="$IMAGE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.digitalocean.com/?refcode=7895291a5a1b