mingfang
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
it's still a problem. I think the coder above may be the problem;
i think the stop scripts should run before the ssh server is shutdown
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
should this https://github.com/coder/coder/blame/f6e990ed875f7e7f273b8a6f5c03c3475a7bb026/agent/agent.go#L1552
run before the ssh server shutdown here https://github.com/coder/coder/blame/f6e990ed875f7e7f273b8a6f5c03c3475a7bb026/agent/agent.go#L1537 ?
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
that caused a validation error
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
It turns out the shutdown script is running but it didn't get a chance to finish.
I'm guessing it is because the ssh server got killed before the script gets a chance to finish.
Here is the part of the agent log that shows the shutdown sequence.
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
Here is the build log
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
I don't have a lock file.
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
https://github.com/mingfang/coder-templates/blob/master/catalog/providers.tf
I left it blank so it should be the "latest", correct?
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
My template is made up of several Terraform files.
https://github.com/mingfang/coder-templates/tree/master/catalog
The shutdow script is here https://github.com/mingfang/coder-templates/blob/master/catalog/main.tf#L108
The purpose of this template is to provide a catalog of services to try out.
The service should start and shutdown along of the workspace.
You can click on the link to the service(e.g. Kestra) from github to try it yourself.
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
Sorry I was not being clear.
I'm trying to run a script on stop and not on delete.
I've tried these and they are not working.
and
Question is...why is this not working?
45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
@Phorcys
thanks for the explanation.
for my use case I need the script to run on the workspace.
i was hoping that I can use
coder_script
https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script#run_on_stop-1
but i have not been able to get a simple echo hello
to work45 replies
CCoder.com
•Created by Conor on 2/23/2024 in #help
How does the coder_script terraform resource work?
I have the same use case; I need to manually stop some external processes on shutdown.
How can
local-exec
help in this case?45 replies