Martí
Martí
CCoder.com
Created by Martí on 1/17/2025 in #help
coder_agent shutdown / coder_script run_on_stop not working
Hi, I'm creating a set of script to run on start and stop. Start scripts run as expected, but run_on_stop scripts (or shutdown) not executing, there is my code
resource "coder_script" "manage_account" {
...
run_on_stop = true
run_on_start = true
script = templatefile("${path.module}/templates/manage_account.tpl", {
...
})
log_path = "/full_home/tmp/manage_account_${data.coder_workspace.me.transition}.log"
}
resource "coder_script" "manage_account" {
...
run_on_stop = true
run_on_start = true
script = templatefile("${path.module}/templates/manage_account.tpl", {
...
})
log_path = "/full_home/tmp/manage_account_${data.coder_workspace.me.transition}.log"
}
I found the /full_home/tmp/manage_account_start.log, but not stop log, and stop action is not executed. Any idea with this? Thanks!
13 replies
CCoder.com
Created by Martí on 10/21/2024 in #help
deploy coder_agent with for_each loop
hi there, i'm trying to deploy coder_agent with a for_each loop, but when it's deploying i receive this error "duplicate agent name", but is not any "name" parameter at resource "coder_agent", any idea to fix this? kind regards! resource "coder_agent" "platform" { for_each = local.enabled_platform os = "linux" arch = "amd64" startup_script = try(each.value.startup_script, null) } duplicate agent name: platform
5 replies