Skip to content

Commit 1675656

Browse files
committed
fix terraform compose.zip creation planning/timing
Signed-off-by: Marques Johansson <[email protected]>
1 parent d0d9044 commit 1675656

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

deploy/terraform/main.tf

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ data "archive_file" "compose" {
8484
output_path = "${path.module}/compose.zip"
8585
}
8686

87+
locals {
88+
compose_zip = data.archive_file.compose.output_size > 0 ? "" : filebase64("${path.module}/compose.zip")
89+
}
90+
8791
data "cloudinit_config" "setup" {
8892
depends_on = [
8993
data.archive_file.compose,
90-
// resource.null_resource.setup
9194
]
9295
gzip = false # not supported on Equinix Metal
9396
base64_encode = false # not supported on Equinix Metal
@@ -99,7 +102,7 @@ data "cloudinit_config" "setup" {
99102
part {
100103
content_type = "text/cloud-config"
101104
content = templatefile("${path.module}/cloud-config.cfg", {
102-
COMPOSE_ZIP = filebase64("${path.module}/compose.zip")
105+
COMPOSE_ZIP = local.compose_zip
103106
WORKER_MAC = metal_device.tink_worker.ports[1].mac
104107
PROVISIONER_IP = metal_device.tink_provisioner.network[0].address
105108
})

0 commit comments

Comments
 (0)