diff options
author | EuAndreh <eu@euandre.org> | 2020-08-02 18:52:39 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-08-02 18:52:39 -0300 |
commit | dc853c12680c71fa16c3c912603bd110d7c25cfd (patch) | |
tree | 93e5fcf6479d09cde6f46c007d66fbcaac195f07 | |
parent | vps.tf: Name VPS volume derived from droplet name (diff) | |
download | server-dc853c12680c71fa16c3c912603bd110d7c25cfd.tar.gz server-dc853c12680c71fa16c3c912603bd110d7c25cfd.tar.xz |
Use a name from the environment for the names of the host and the volume
-rw-r--r-- | secrets/secret-envrc.sh | bin | 2524 -> 2708 bytes | |||
-rw-r--r-- | vps.tf | 14 |
2 files changed, 12 insertions, 2 deletions
diff --git a/secrets/secret-envrc.sh b/secrets/secret-envrc.sh Binary files differindex 4f97639..02f4ab6 100644 --- a/secrets/secret-envrc.sh +++ b/secrets/secret-envrc.sh @@ -20,6 +20,16 @@ variable "nextcloud_tld_prefix" { description = "DNS prefix used for the Nextcloud installation. Does not contain a dot at the end." } +variable "hostname" { + type = string + description = "Human name of the host. This is a pet name, not cattle name :)" +} + +variable "volume_name" { + type = string + description = "Name of the volume, which will also be the name of it's mount point." +} + # DigitalOcean provider "digitalocean" { @@ -36,7 +46,7 @@ resource "digitalocean_ssh_key" "client" { resource "digitalocean_droplet" "vps" { image = "ubuntu-18-04-x64" - name = "sovereignty" + name = var.hostname region = "nyc3" size = "s-1vcpu-1gb" backups = true @@ -64,7 +74,7 @@ resource "digitalocean_droplet" "vps" { resource "digitalocean_volume" "vps_persistent_volume" { region = "nyc3" - name = "${digitalocean_droplet.vps.name}-volume" + name = var.volume_name size = 10 initial_filesystem_type = "ext4" description = "Persistent disk to store docker volumes contents across droplets being created and destroyed" |