1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

win_rds: wait for reboot to be complete (#51849)

This commit is contained in:
Jordan Borean 2019-02-07 10:51:11 +10:00 committed by GitHub
parent d252cc7a2b
commit 6fcbfcf6b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,9 +19,24 @@
- name: reboot server if needed
win_reboot:
post_reboot_delay: 10
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
include_tasks: win_rds_cap.yml