--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/13e7ac83-2de6-49bd-8a53-420ccfdd9996%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
So it successfully copies, but then I run the following commands
So hear I'm copying the original copy into a new copy, and then making a copy of that called "new.sh" and executing it. When I execute it my results are:
So you can see the original copy in my home dir has now become zero'd out, but the copy of the "copy of the original" is still in tact and so is "new.sh". Also, there is a new file now in my home directory called "terraform_324111250.sh".
So yes what you said makes sense when I see /tmp/terraform_544541579.sh zero'd out, but how is this following along on my copies in my home directory, like I described above?
Where is this new file coming from ( terraform_324111250.sh ) and how come only the copy of the original is zerod out in my home directory (not the copy of original)? This is the "magic" I'm referring to. When I run a `ps -U <user id>` of the user I'm terraforming as, I see no processes, so I'm not sure what is executing this "erase" on the target host?
Thanks!
Tony,I’m not sure, nothing screams out to me as obvious.You can see the exact place we zero out the file here: https://github.com/hashicorp/terraform/blob/bf529839a8d53be3279678a30fdc2e1dcd916ebc/builtin/provisioners/remote-exec/resource_provisioner.go#L209As you can see, it is very simple and uses only SCP. We don’t run any processes on the remote machine. We upload an empty file exactly to the path where we originally executed it (`remotePath`). Note that remotePath is a Go string variable that is never modified so it is impossible for the remote machine to effect the value of that. Therefore, I don’t think this exact line is zero-ing out your file.The only thing I can imagine is that there are symlinks being used somewhere. Terraform probably isn’t doing this, though.
Best,
Mitchell
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/160af742-2131-4165-9f91-3e5dbd8a6940%40googlegroups.com.