Skip to content

Commit

Permalink
Add a startup script delay to annotated domain controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
glattercj committed Sep 9, 2023
1 parent 40d33f6 commit d65ab2c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/go/tmpl/templates/windows_startup.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
{{ $dc := index .Node.Annotations "phenix/domain-controller" }}

{{ if toBool $dc }}
while ($true) {
try {
Get-ADDomain | Out-Null
Write-Host "[+] Domain Controller services ready!"
break
} catch {
Write-Host "[-] Waiting for Domain Controller services to be ready..."
Start-Sleep -Seconds 20
}
}
{{ end }}

function Phenix-SetStartupStatus($status) {
echo "Marking phenix startup as $status in registry..."

Expand Down

0 comments on commit d65ab2c

Please sign in to comment.