diff options
| author | EuAndreh <eu@euandre.org> | 2019-05-28 23:18:16 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2019-05-28 23:18:16 -0300 |
| commit | c0c0aa98d88c2a62792ed7b4f9b150774b66d07e (patch) | |
| tree | 9e5181e7363d94cb8fd8c12cbeb15464c3a68db7 | |
| parent | Split $VPS_COMMIT_SHA variable declaration for exporting (diff) | |
| download | toph-c0c0aa98d88c2a62792ed7b4f9b150774b66d07e.tar.gz toph-c0c0aa98d88c2a62792ed7b4f9b150774b66d07e.tar.xz | |
Use Floating IP on Droplet
| -rw-r--r-- | TODOs.org | 8 | ||||
| -rw-r--r-- | secrets/envrc.sh | bin | 1493 -> 1541 bytes | |||
| -rw-r--r-- | vps.tf | 6 |
3 files changed, 13 insertions, 1 deletions
@@ -25,8 +25,8 @@ CLOSED: [2019-05-26 Sun 19:42] Put it in an environment variable? Done by appending to content of =~/.ssh/config=. +**** DOING Use DigitalOcean's Floating IP in front of the droplet **** DOING Automate deployment with Terraform and deployment scripts -**** NEXT Use DigitalOcean's Floating IP in front of the droplet **** DONE Backup data during deployments CLOSED: [2019-05-28 Tue 00:48] Is this approach feasible? Will it make the deployment take too much longer? What are the alternatives? @@ -120,6 +120,12 @@ I'm already covered by using Git Annex for almost everything. ** WAITING =matrix.euandreh.org=: Matrix Synapse server I'm not using IRC a lot right now. Wait for me to interact more with mailing lists and gauge the need of IRC. * Questions +** TODO How to dynamically handle Floating IPs? +Right now the current Floating IP defined in =.envrc= was created manually in DigitalOcean's web UI and copied from it to the environment variable. + +If everything was teared down, I couldn't recreate everything from source, because the Floating IP would be different. + +The ultimate goal would be to upsert a Floating IP address? If no Floating IP address exists, create one. If one already exists (I don't how to get a reference to it), use it. ** TODO Critiques of Docker? What does NixOps, DisNix and Dysnomia are trying to accomplish that overlap with Docker? diff --git a/secrets/envrc.sh b/secrets/envrc.sh Binary files differindex 52e5ac1..fb573ba 100644 --- a/secrets/envrc.sh +++ b/secrets/envrc.sh @@ -1,5 +1,6 @@ variable "do_token" {} variable "ssh_fingerprint" {} +variable "floating_ip" {} provider "digitalocean" { token = "${var.do_token}" @@ -30,3 +31,8 @@ resource "digitalocean_droplet" "vps" { script = "./deploy.sh" } } + +resource "digitalocean_floating_ip_assignment" "vps" { + ip_address = "${var.floating_ip}" + droplet_id = "${digitalocean_droplet.vps.id}" +}
\ No newline at end of file |
