ScaleComputing / HyperCoreAnsibleCollection

Official Ansible collection for Scale Computing SC//HyperCore (HC3) v1 API
GNU General Public License v3.0
12 stars 8 forks source link

:lady_beetle: Bug: version_update_single_node role isn't waiting for update to actually start up and concluding it's done #258

Closed ddemlow closed 11 months ago

ddemlow commented 11 months ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

https://github.com/ScaleComputing/HyperCoreAnsibleCollection/blob/main/roles/version_update_single_node/tasks/main.yml needs to wait for update to actually start before initial status check.

probably better solutions available but adding a 60 second wait in my case was sufficient (in some others might need a longer wait or more advanced comparison to tell that update actually is started or at least attempted to start and then terminated)

----------------- UPDATE --------------------

- name: Update single-node system
  scale_computing.hypercore.version_update:
    icos_version: "{{ version_update_single_node_desired_version }}"
  register: version_update_single_node_update_result

- name: wait 60 seconds
  wait_for:
    timeout: 60

- name: Check update status
  ansible.builtin.include_tasks: update_status_check.yml

- name: Show update result
  ansible.builtin.debug:
    var: version_update_single_node_update_result

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System Info (please complete the following information):

Additional context

Add any other context about the problem here.

justinc1 commented 11 months ago

The bug was added with 355e65a6254883da54796665ac063b4c2d78d29c, where we (em, I...) removed the 60 sec delay.

The role is tested only manually, it is hard to find race conditions.

More advanced condition - we could use version_update_status_info and look at record.to_version output.