-
Notifications
You must be signed in to change notification settings - Fork 9.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiple remote-exec's against the same target overwrite script.sh #1545
Comments
mitchellh
added a commit
that referenced
this issue
Apr 18, 2015
mitchellh
added a commit
that referenced
this issue
Apr 18, 2015
Fixed in PR #1588. Nice edge case catch! Thanks. |
mitchellh
added a commit
that referenced
this issue
Apr 20, 2015
helper/ssh: add random number to upload path for script [GH-1545]
Thanks so much! |
marvinpinto
added a commit
to freshbooks/terraform
that referenced
this issue
Apr 20, 2015
* origin/master: update CHANGELOG provider/aws: fix vet error, missing fmt param update CHANGELOG update CHANGELOG update CHANGELOG terraform: don't panic on input for bad default type [hashicorpGH-1344] helper/ssh: add random number to script [hashicorpGH-1545] Allow using deprecated security_groups in NI spec provider/aws: Fix issue when creating ELB with no tags Refresh state for deleted s3 bucket correctly Added Docker links support to the docker_container resource. providers/aws: check allocationId only if it's vpc, fixes hashicorp#1345
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. |
ghost
locked and limited conversation to collaborators
May 3, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm using terraform's
remote-exec
provisioner with inline argument to run a script on my configuration management server whenever a new instance is provisioned. This allows me to pass Terraform variables directly into the script, which is very convenient.Crucially, in case this wasn't clear, I'm using
remote-exec
to execute not on the instance the enclosing resource block describes, but on another central server.This method works well so long as I provision one new instance at a time. However, if multiple instances are provisioned at once, since
remote-exec
always names its script/tmp/script.sh
on the destination server, parallel terraform-remote-exec processes sometimes knock each other's scripts over while executing.A snippet from my app.tf:
I have similar provisioners in TF files for different server roles, and have seen a terraform run with output including:
...which should be managing a key for 'es0.MYDOMAIN.com' but the script.sh was swapped in mid-run due to another simultaneous provisioner.
Could terraform add entropy to the end of a script name, ie. /tmp/script-0EB5.sh, or a timestamp, or some other way to prevent collision?
The text was updated successfully, but these errors were encountered: