Add post delay to reboot

Leapp may reconfigure network after main upgrade. Also systemd may bring
down and up again network unit. This patch adds post_reboot_delay as 2 min to
mitigate such issues which can be configurable as heat variable in
customers env files for some very specific cases. Also test_command is
changed from whoami to systemctl to have better assesment when a system
completed its boot.

Closes-Bug: rhbz#1920293

Change-Id: Iaa6fdef24599072f5a31c1fd2da29c276399c83d
(cherry picked from commit a9bf1c1285)
This commit is contained in:
Sergii Golovatiuk 2021-01-26 02:00:54 +01:00 committed by Jesse Pretorius
parent 25c10064e3
commit 1dc7be85bb
1 changed files with 10 additions and 0 deletions

View File

@ -59,6 +59,12 @@ parameters:
description: Timeout (seconds) for the OS upgrade phase via Leapp description: Timeout (seconds) for the OS upgrade phase via Leapp
type: number type: number
default: 3600 default: 3600
UpgradeLeappPostRebootDelay:
description: |
Maximum (seconds) to wait for machine to reboot and respond to a test
command.
type: number
default: 120
UpgradeLeappToRemove: UpgradeLeappToRemove:
default: [] default: []
description: List of packages to remove during Leapp upgrade. description: List of packages to remove during Leapp upgrade.
@ -131,6 +137,7 @@ outputs:
upgrade_leapp_devel_skip: {get_param: UpgradeLeappDevelSkip} upgrade_leapp_devel_skip: {get_param: UpgradeLeappDevelSkip}
upgrade_leapp_command_options: {get_param: UpgradeLeappCommandOptions} upgrade_leapp_command_options: {get_param: UpgradeLeappCommandOptions}
upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout} upgrade_leapp_reboot_timeout: {get_param: UpgradeLeappRebootTimeout}
upgrade_leapp_post_reboot_delay: {get_param: UpgradeLeappPostRebootDelay}
vars: vars:
_upgradeLeappEnabled: {get_param: UpgradeLeappEnabled} _upgradeLeappEnabled: {get_param: UpgradeLeappEnabled}
tags: tags:
@ -213,6 +220,9 @@ outputs:
- name: reboot to perform the upgrade - name: reboot to perform the upgrade
reboot: reboot:
reboot_timeout: "{{upgrade_leapp_reboot_timeout}}" reboot_timeout: "{{upgrade_leapp_reboot_timeout}}"
test_command: >-
systemctl is-system-running | grep -e running -e degraded
post_reboot_delay: "{{ upgrade_leapp_post_reboot_delay }}"
- name: Package and repo update tasks - name: Package and repo update tasks
when: step|int == 0 when: step|int == 0