Closed pastafari closed 9 years ago
If you are not inside of a VPC (or bastion host-like environment, i.e. no ssh hopping), you could use a remote-exec
(which has retry logic on connection refused) as the first provisioner that does nothing to do it.
provisioner "remote-exec" {
inline = ["# Connected!"]
}
@stephenchu that is a great idea. Thanks! :+1:
Essentially, I'm doing a remote-exec via a local script.
I was wondering if this is a common enough use case to warrant it being first class in local-exec.
Closing this as its not really an issue. Thanks again @stephenchu for the idea.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Hi,
We're using chef-solo as our provisioning tool, and I wanted to know the best way to integrate it with a terraform provision block. Here's what I need to do:
I have local scripts that do 2 and 3 given a remote IP, key and run list. I added both scripts to a
local-exec
block like so:Now, what happens is that the digital ocean droplet comes up, but OpenSSH takes some time to start, so when the provisioner gets triggered, my bootstrap script is unable to connect to the droplet.
One way around this would be to add a sleep-until-i-can-connect loop in the bootstrap script. Another way would be to delegate that to terraform, like
remote-exec
does (correct me if I'm wrong!) via its connection block.What would you recommend?