Skip to content

Commit 8a0ebb4

Browse files
anazobecjustinc1
authored andcommitted
Fix typo in update_status_check, fix force shutdown.
1 parent 94383ff commit 8a0ebb4

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

roles/version_update_single_node/tasks/shutdown_vms.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@
99
- name: Shutdown running VMs
1010
scale_computing.hypercore.vm_params:
1111
vm_name: "{{ item.vm_name }}"
12-
power_state: stop
12+
power_state: shutdown
1313
when: item.power_state == 'started'
1414
loop: "{{ vms.records }}"
1515
register: vm_shutdown_result
16+
ignore_errors: true # if VMs fail to shut down without force, error will occur, so we skip and try on to shut down with force
1617

1718
- name: Show shutdown results
1819
ansible.builtin.debug:
1920
var: vm_shutdown_result
21+
22+
- name: Force shutdown the remaining running VMs
23+
scale_computing.hypercore.vm_params:
24+
vm_name: "{{ item.item.vm_name }}"
25+
power_state: stop
26+
when: item.item.power_state == 'started'
27+
loop: "{{ vm_shutdown_result.results }}"
28+
register: vm_stop_result
29+
30+
- name: Show VM stop results
31+
ansible.builtin.debug:
32+
var: vm_stop_result

roles/version_update_single_node/tasks/update_status_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
block:
44
- name: Increment retry_count
55
ansible.builtin.set_fact:
6-
retry_count: "{{ 0 if retry_count is undefined else retries | int + 1 }}"
6+
retry_count: "{{ 0 if retry_count is undefined else retry_count | int + 1 }}"
77

88
# We might be able to remove this task
99
- name: Pause before checking update status - checks will report FAILED-RETRYING until update COMPLETE/TERMINATED

0 commit comments

Comments
 (0)