ocp-power-automation/ocp4-upi-powervs

scp error when using latest Terraform 1.1.7

christopher-horn opened this issue · 1 comments

When using the latest Terraform 1.1.6 or 1.1.7 binaries there seems some change in ~ expansion behavior.

If the ~/ is expanded to /root/ in prepare.tf and install.tf things seem to work okay.

Otherwise I am seeing errors like the following:

module.prepare.null_resource.bastion_init[0]: Provisioning with 'file'...
Error: file provisioner error

  with module.prepare.null_resource.bastion_init[0],
  on modules/1_prepare/prepare.tf line 134, in resource "null_resource" "bastion_init":
 134:   provisioner "file" {

Upload failed: scp: ~/.ssh: No such file or directory

And:

module.install.null_resource.config: Provisioning with 'file'...
Error: file provisioner error

   with module.install.null_resource.config,
   on modules/5_install/install.tf line 161, in resource "null_resource" "config":
  161:   provisioner "file" {
 
Upload failed: scp: ~/ocp4-helpernode: No such file or directory

This is happening when our automation runs detached in background or I run interactively from a terminal.

Terraform v1.1.7
on linux_amd64

  • provider registry.terraform.io/community-terraform-providers/ignition v2.1.2
  • provider registry.terraform.io/hashicorp/null v2.1.2
  • provider registry.terraform.io/hashicorp/random v2.3.1
  • provider registry.terraform.io/ibm-cloud/ibm v1.39.1

Thanks for reporting this. It is the result of an intentional change in the remote "scp" command to address a security-related concern. The destination argument is no longer subject to shell expansion on the remote system.
This should be fixed by #387