oVirt / ovirt-ansible-collection

Ansible collection with official oVirt modules and roles
72 stars 90 forks source link

backport: Wait for host to be in result state (#621) #667

Closed mwperina closed 1 year ago

mwperina commented 1 year ago

Bug introduced in #580. The update_available is false just after the upgrade, and HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED is logged. But the host is not yet rebooted, so we still need to wait for the status to be UP or MAINTENANCE.

Signed-off-by: Martin Nečas necas.marty@gmail.com

In #580 we introduced a check on update_available state of the host to determine if the host upgrade finished when there were no updates available for te host.

The downside of this is that when the update finishes, the update_available flag is cleared, and ansible thinks the host upgrade is complete and starts upgrading the next node. But the reboot is not completed yet, so result_state != h.status.

The fix here is to save the update_available status before starting the update. If there were no updates and status hasn't changed, then it goes on. If there was an update on the other hand, it will wait for the HOST_UPGRADE_FAILED / HOST_UPGRADE_FINISHED / HOST_UPGRADE_FINISHED_AND_WILL_BE_REBOOTED events.

Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be Signed-off-by: Martin Nečas necas.marty@gmail.com

Signed-off-by: Martin Nečas necas.marty@gmail.com Signed-off-by: Jean-Louis Dupond jean-louis@dupond.be Co-authored-by: Martin Nečas necas.marty@gmail.com