Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Workaround Terraform v1.1 file provisioner regression
Browse files Browse the repository at this point in the history
* Terraform v1.1 changed the behavior of provisioners and
`remote-exec` in a way that breaks support for expansions
in commands (including file provisioner, where `destination`
is part of an `scp` command)
* Terraform will likely revert the change eventually, but I
suspect it will take a while
* Instead, we can stop relying on Terraform's expansion
behavior. `/home/core` is a suitable choice for `$HOME` on
both Flatcar Linux and Fedora CoreOS (harldink `/var/home/core`)

Rel: hashicorp/terraform#30243
  • Loading branch information
dghubble committed Dec 28, 2021
1 parent acc9f70 commit ea96703
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ssh.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ resource "null_resource" "copy-controller-secrets" {

provisioner "file" {
content = module.bootstrap.kubeconfig-kubelet
destination = "$HOME/kubeconfig"
destination = "/home/core/kubeconfig"
}

provisioner "file" {
content = join("\n", local.assets_bundle)
destination = "$HOME/assets"
destination = "/home/core/assets"
}

provisioner "remote-exec" {
inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo mv /home/core/kubeconfig /etc/kubernetes/kubeconfig",
"sudo /opt/bootstrap/layout",
]
}
Expand All @@ -66,12 +66,12 @@ resource "null_resource" "copy-worker-secrets" {

provisioner "file" {
content = module.bootstrap.kubeconfig-kubelet
destination = "$HOME/kubeconfig"
destination = "/home/core/kubeconfig"
}

provisioner "remote-exec" {
inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo mv /home/core/kubeconfig /etc/kubernetes/kubeconfig",
]
}
}
Expand Down

0 comments on commit ea96703

Please sign in to comment.