Skip to content

Commit

Permalink
terraform: fix file provisioning for worker and provisioner
Browse files Browse the repository at this point in the history
Signed-off-by: Marques Johansson <[email protected]>
  • Loading branch information
displague committed Sep 4, 2020
1 parent 41d92cd commit 5d9099c
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions deploy/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,30 @@ resource "null_resource" "tink_directory" {
host = packet_device.tink_provisioner.network[0].address
}

provisioner "remote-exec" {
inline = [
"mkdir -p /root/tink/deploy"
]
}

provisioner "file" {
source = "../../setup.sh"
destination = "/root/tink/setup.sh"
}

provisioner "file" {
source = "../../generate-envrc.sh"
destination = "/root/tink/generate-envrc.sh"
}

provisioner "file" {
source = "./../../../tink"
destination = "/root/"
source = "../../deploy"
destination = "/root/tink"
}

provisioner "remote-exec" {
inline = [
"chmod +x tink/generate-envrc.sh tink/setup.sh tink/deploy/tls/*.sh"
"chmod +x /root/tink/*.sh /root/tink/deploy/tls/*.sh"
]
}
}
Expand Down Expand Up @@ -109,7 +125,9 @@ data "template_file" "worker_hardware_data" {
}

resource "null_resource" "hardware_data" {
count = var.worker_count
count = var.worker_count
depends_on = [null_resource.tink_directory]

connection {
type = "ssh"
user = var.ssh_user
Expand Down

0 comments on commit 5d9099c

Please sign in to comment.