Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add OS version to check reboot happened
Browse files Browse the repository at this point in the history
In some cases OS of VM shuts down very slowly. After post_reboot_delay
(120 sec) ansible logs in to VM and runs "systemctl
is-system-running | grep -qE "running|degraded" which works perfectly on
RHEL/CentOS 7/8. Ansible will be puzzled as it doesn't detect any other
statuses. This issue was solved in ansible 2.10 by redesigning reboot
module where "boot_time_command" verifies boot_id before and after
reboot. However, we cannot backport ansible 2.10 to product so this
patch adds a little check to detect OS version to keep it simple. This
works as leapp installs RHEL8 in disconnected mode after reboot, ansible
won't be able to connect until leapp is done.

Resolves: rhbz#1980542

Change-Id: I6190ee794dce461077b08b486aef18cbf9cc04b3
  • Loading branch information
holser authored and odyssey4me committed Jul 19, 2021
1 parent 0b87494 commit 2b33594
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ outputs:
- name: reboot to perform the upgrade
reboot:
reboot_timeout: "{{upgrade_leapp_reboot_timeout}}"
# TODO(holser): ansible 2.10 and higher provides boot_time_command to detect boot_id before and after reboot.
test_command: >-
systemctl is-system-running | grep -e running -e degraded
source /etc/os-release; [ "${VERSION_ID%.*}" -ge "8" ] && systemctl is-system-running | grep -qE "running|degraded" || exit 1
post_reboot_delay: "{{ upgrade_leapp_post_reboot_delay }}"

- name: Package and repo update tasks
Expand Down

0 comments on commit 2b33594

Please sign in to comment.