provision: fail fast when the role script is missing

A missing seed payload used to look like a hung stage: the scheduled task
exited immediately and backend_wait polled for an hour. Both backends now
check Test-Path on the role script before scheduling it.
This commit is contained in:
2026-10-26 17:23:36 -04:00
parent 06a9034214
commit 37852b3f0b
2 changed files with 14 additions and 0 deletions
@@ -318,6 +318,14 @@ backend_ready() {
backend_start() { backend_start() {
local name=$1 remote=$2 local name=$1 remote=$2
# Fail in seconds, not after the one-hour marker wait, when the seed
# payload never reached the guest.
if ! backend_ps "$name" "Test-Path '${remote}'" 2>/dev/null | grep -qi true; then
fail "$name: ${remote} is missing — the seed payload was not copied"
return 1
fi
backend_ps "$name" " backend_ps "$name" "
Remove-Item -Force -ErrorAction SilentlyContinue '${remote}.done' Remove-Item -Force -ErrorAction SilentlyContinue '${remote}.done'
schtasks.exe /End /TN NorbourgStage 2>\$null | Out-Null schtasks.exe /End /TN NorbourgStage 2>\$null | Out-Null
+6
View File
@@ -297,6 +297,12 @@ backend_ready() {
backend_start() { backend_start() {
local name=$1 remote=$2 local name=$1 remote=$2
if ! _labwinrm "$name" ps "Test-Path '${remote}'" 2>/dev/null | grep -qi true; then
fail "$name: ${remote} is missing — the seed payload was not copied"
return 1
fi
_labwinrm "$name" start "$remote" _labwinrm "$name" start "$remote"
} }