Skip to content

Commit

Permalink
add task to check decryption failure
Browse files Browse the repository at this point in the history
Signed-off-by: Yanan Shen <yanans@vmware.com>
  • Loading branch information
123lzxm committed Nov 15, 2023
1 parent f04f1bc commit b620277
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions windows/utils/win_disable_bitlocker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@
- name: "Check if Decryption is completed"
ansible.windows.win_shell: "(Get-BitLockerVolume | Where-Object { $_.EncryptionPercentage -GT 0 } | measure).Count"
register: win_powershell_cmd_output
register: decrypt_volume_result
delegate_to: "{{ vm_guest_ip }}"
ignore_errors: true
until:
- win_powershell_cmd_output.stdout_lines[0] | int == 0
- decrypt_volume_result.stdout_lines[0] | int == 0
retries: "{{ (decrypt_wait_time | int / 60) | int }}"
delay: 60

- name: "Volume decryption failed"
ansible.builtin.fail:
msg: "Failed to decrypt the OS volumes in {{ decrypt_wait_time }} seconds."
when:
- decrypt_volume_result.failed is defined
- decrypt_volume_result.failed

- name: "Get BitLocker encrypted volumes"
include_tasks: ../utils/win_get_bitlocker_volume.yml

Expand Down

0 comments on commit b620277

Please sign in to comment.