From 2b33594c1958107b8170d20be5f17f74093fee62 Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Mon, 12 Jul 2021 18:03:42 +0200 Subject: [PATCH] Add OS version to check reboot happened 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 --- .../tripleo-packages/tripleo-packages-baremetal-puppet.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index 5d57fbe724..2e0b56cdd2 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -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