Version: Terraform v0.11.1
I'm having an issue where, I'm using the terraform-provider-vsphere, to stand up a VM in vsphere, and upload a python script, and then run the python script. However, on some occasions (seems random), after the file upload, it fails the following `provisioner "remote-exec"` stage as it can't find the file. Around 80% it works fine, so I'm a bit stumped...
```
* stat /.../terraform/test_env/.terraform/modules/f841ba80c506702640750cd77038b2e4/scripts/deploy.py: no such file or directory
* module.inf-win7.vsphere_virtual_machine.vpshere_build_machine: 1 error(s) occurred:
```
It seems that the file it is trying to locate is on the local machine and not on the remote one?
Thanks!
# Create virtual machine and provision deployment
resource "vsphere_virtual_machine" "vpshere_build_machine" {
name = "${var.vm_name}"
folder = "${var.vm_folder}"
...
# Upload deploy script
provisioner "file" {
connection {
type = "${var.connection_type}"
insecure = true
user = "${var.user}"
password = "${var.password}"
}
source = "${path.module}/scripts/deploy.py"
destination = "${var.working_dir}/deploy.py"
}
# Run deploy script on remote machine
provisioner "remote-exec" {
connection {
type = "${var.connection_type}"
insecure = true
user = "${var.user}"
password = "${var.password}"
}
inline = [
"python ${var.working_dir}/deploy.py"
]
}
}