win_rds: wait for reboot to be complete (#51849)
This commit is contained in:
parent
d252cc7a2b
commit
6fcbfcf6b6
1 changed files with 16 additions and 1 deletions
|
@ -19,9 +19,24 @@
|
||||||
|
|
||||||
- name: reboot server if needed
|
- name: reboot server if needed
|
||||||
win_reboot:
|
win_reboot:
|
||||||
post_reboot_delay: 10
|
|
||||||
when: rds_install.reboot_required
|
when: rds_install.reboot_required
|
||||||
|
|
||||||
|
# After a reboot Windows is still configuring the feature, this is a hack to wait until that is finished
|
||||||
|
- name: wait for component servicing to be finished
|
||||||
|
win_shell: |
|
||||||
|
$start = Get-Date
|
||||||
|
$path = "HKLM:\SYSTEM\CurrentControlSet\Control\Winlogon\Notifications\Components\TrustedInstaller"
|
||||||
|
$tries = 0
|
||||||
|
while ((Get-ItemProperty -Path $path -Name Events).Events.Contains("CreateSession")) {
|
||||||
|
$tries += 1
|
||||||
|
Start-Sleep -Seconds 5
|
||||||
|
if (((Get-Date) - $start).TotalSeconds -gt 180) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tries
|
||||||
|
changed_when: False
|
||||||
|
|
||||||
- name: run win_rds_cap integration tests
|
- name: run win_rds_cap integration tests
|
||||||
include_tasks: win_rds_cap.yml
|
include_tasks: win_rds_cap.yml
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue