Skip to content

Commit

Permalink
save the powershell result before using it in when condition (vmware#434
Browse files Browse the repository at this point in the history
)

Signed-off-by: Yanan Shen <[email protected]>
  • Loading branch information
123lzxm committed Mar 16, 2023
1 parent cf02c51 commit d336edd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions windows/mdag_enable_disable/enable_mdag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
win_powershell_cmd: "Get-Process -Name {{ mdag_process }}"
win_execute_cmd_ignore_error: true

- name: "Set the result of getting MDAG process"
ansible.builtin.set_fact:
mdag_process_result: "{{ win_powershell_cmd_output }}"

- name: "Check MDAG process {{ mdag_process }} after restart"
block:
- name: "Restart the guest OS"
Expand All @@ -118,5 +122,5 @@
win_powershell_cmd: "Get-Process -Name {{ mdag_process }}"
when:
- guest_os_build_num | int > 22000
- win_powershell_cmd_output.rc is defined
- win_powershell_cmd_output.rc != 0
- mdag_process_result.rc is defined
- mdag_process_result.rc != 0

0 comments on commit d336edd

Please sign in to comment.