Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Yanan Shen <[email protected]>
  • Loading branch information
123lzxm committed Apr 13, 2023
1 parent 6f6f917 commit cefdbe9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions windows/mdag_enable_disable/enable_mdag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
mdag_process: "vmmemMDAG"
virtual_process: "vmcompute"

- name: "Initialize the status of MDAG process"
ansible.builtin.set_fact:
mdag_process_running: false

- name: "Get virtual process {{ virtual_process }} before restart"
include_tasks: ../utils/win_execute_cmd.yml
vars:
Expand All @@ -107,7 +111,8 @@

- name: "Set the result of getting MDAG process"
ansible.builtin.set_fact:
mdag_process_result: "{{ win_powershell_cmd_output }}"
mdag_process_running: "{{ true if win_powershell_cmd_output.rc == 0 else false }}"
when: win_powershell_cmd_output.rc is defined

- name: "Check MDAG process {{ mdag_process }} after restart"
block:
Expand All @@ -121,7 +126,15 @@
vars:
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_running: "{{ true if win_powershell_cmd_output.rc == 0 else false }}"
when: win_powershell_cmd_output.rc is defined
when:
- guest_os_build_num | int > 22000
- mdag_process_result.rc is defined
- mdag_process_result.rc != 0
- not mdag_process_running

- name: "Display status of the MDAG process {{ mdag_process }}"
ansible.builtin.debug:
msg: "MDAG process {{ mdag_process }} running status: {{ mdag_process_running }}"

0 comments on commit cefdbe9

Please sign in to comment.