Skip to content

Commit

Permalink
Drop non-docker droplet setup from ooni_th_droplet
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Sep 25, 2024
1 parent 811fed9 commit dcadff4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
30 changes: 0 additions & 30 deletions tf/modules/ooni_th_droplet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,6 @@ terraform {
}
}

data "cloudinit_config" "ooni_th" {
gzip = false
base64_encode = false

part {
filename = "init.cfg"
content_type = "text/cloud-config"
content = templatefile("${path.module}/templates/cloud-init.yml", {
distro_id = "ubuntu",
distro_codename = "jammy"
})
}

}

resource "digitalocean_droplet" "ooni_th" {
image = "ubuntu-24-04-x64"
name = "${var.name}-${var.stage}-${count.index}"
region = var.instance_location
size = var.instance_size
ipv6 = true
ssh_keys = var.ssh_keys
user_data = data.cloudinit_config.ooni_th.rendered
count = var.droplet_count

lifecycle {
create_before_destroy = true
}
}

data "cloudinit_config" "ooni_th_docker" {
gzip = false
base64_encode = false
Expand Down
7 changes: 5 additions & 2 deletions tf/modules/ooni_th_droplet/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
output "droplet_ipv4_address" {
value = digitalocean_droplet.ooni_th[*].ipv4_address
value = digitalocean_droplet.ooni_th_docker[*].ipv4_address
}

output "droplet_addresses" {
value = aws_route53_record.ooni_th[*].fqdn
# for why we use values,
# see: https://github.com/hashicorp/terraform/issues/23245#issuecomment-548391304
# https://github.com/hashicorp/terraform/issues/22476
value = values(aws_route53_record.ooni_th)[*].fqdn
}

0 comments on commit dcadff4

Please sign in to comment.