diff options
author | Jesse Luehrs <doy@tozt.net> | 2018-10-15 23:47:06 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2018-10-15 23:47:06 -0400 |
commit | 51722cfaf0e0a852e440173152f822b155af328f (patch) | |
tree | 123a0b80fb0802ee758c69128e0089267a5652a6 /bin/helpers | |
parent | cf70bdcd8951fa0784cc0cac2115c1840840f2ac (diff) | |
download | puppet-tozt-51722cfaf0e0a852e440173152f822b155af328f.tar.gz puppet-tozt-51722cfaf0e0a852e440173152f822b155af328f.zip |
start refactoring some of my scripts
Diffstat (limited to 'bin/helpers')
-rwxr-xr-x | bin/helpers/launch-tozt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/bin/helpers/launch-tozt b/bin/helpers/launch-tozt new file mode 100755 index 0000000..06dc07d --- /dev/null +++ b/bin/helpers/launch-tozt @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -eu +set -o pipefail + +echo "Creating droplet for tozt..." +id=$(doctl compute droplet create \ + tozt \ + --image debian-9-x64 \ + --region nyc3 \ + --size s-1vcpu-1gb \ + --ssh-keys 23160354 \ + --volumes 4206344e-cf4f-11e8-a5a7-0a58ac1465db \ + --format ID \ + --no-header \ + --wait) +echo "Created droplet with id $id" + +echo "Assigning floating ip to tozt..." +# XXX this returns an error for some reason, but actually succeeds: +# Error: could not assign IP to droplet: json: cannot unmarshal number +# 2328181259 into Go struct field Action.resource_id of type int +doctl compute floating-ip-action assign 138.197.58.11 "$id" || true +echo "Done assigning floating ip" + +echo "Provisioning droplet..." +"$(dirname "$0")/bootstrap" + +echo "Done" |