[train-only] Add the ability to remove leapp actors

It may be necessary to remove specific actors from the leapp
process to unblock the upgrades. An example included in this
patch is the persistentnetnamesdisable which needs to be
removed in order to prevent requiring a reboot after renaming
the network interfaces.

In this patch we add the ability to define actors to be removed
just before running leapp. The hook is role-specific to allow
maximum flexibility.

Resolves: rhbz#1984875

Change-Id: Id9c141b19383505c1a95948823722822b814bde1
This commit is contained in:
Jesse Pretorius (odyssey4me) 2021-07-22 13:29:28 +01:00 committed by Sergii Golovatiuk
parent 354b54b53e
commit ba8b010d6c
4 changed files with 26 additions and 0 deletions

View File

@ -99,6 +99,14 @@ parameters:
List of modules to unload from the system due to being incompatible
with the next RHEL version. If not being unloaded Leapp will
inhibit the upgrade.
LeappActorsToRemove:
type: comma_delimited_list
default: []
description: |
List of actors to remove from the leapp process to prevent them
from inhibiting the upgrade.
tags:
- role_specific
LeappInitCommand:
type: string
description: |
@ -155,6 +163,7 @@ resources:
upgrade_leapp_to_remove: UpgradeLeappToRemove
upgrade_leapp_to_install: UpgradeLeappToInstall
upgrade_leapp_modules_to_unload: LeappUnloadKernelDrivers
upgrade_leapp_actors_to_remove: LeappActorsToRemove
upgrade_init_command: UpgradeInitCommand
- values: {get_param: [RoleParameters]}
- values:
@ -164,6 +173,7 @@ resources:
UpgradeLeappToRemove: {get_param: UpgradeLeappToRemove}
UpgradeLeappToInstall: {get_param: UpgradeLeappToInstall}
LeappUnloadKernelDrivers: {get_param: LeappUnloadKernelDrivers}
LeappActorsToRemove: {get_param: LeappActorsToRemove}
UpgradeInitCommand: {get_param: UpgradeInitCommand}
outputs:
@ -398,6 +408,13 @@ outputs:
regexp: "{{ item }}"
state: absent
loop: "{{ modules_to_unload }}"
- name: Remove leapp actors to prevent them inhibiting the upgrade
vars:
actors_to_remove: { get_attr: [RoleParametersValue, value, 'upgrade_leapp_actors_to_remove']}
file:
path: /usr/share/leapp-repository/repositories/system_upgrade/el7toel8/actors/{{ item }}/actor.py
state: absent
loop: "{{ actors_to_remove }}"
- name: set leapp required answers
shell: |
# PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD

View File

@ -26,6 +26,7 @@ parameter_defaults:
UpgradeLeappDevelSkip: ''
UpgradeLeappToInstall: []
UpgradeLeappToRemove: []
LeappActorsToRemove: []
# After the upgrade converge the ceph upgrade starts.
# We need to reset the ceph-ansible repo validations.
CephAnsibleWarning: true

View File

@ -22,6 +22,7 @@ parameter_defaults:
# OpenStack packages to upgrade with the OS upgrade.
UpgradeLeappToRemove: ['openvswitch2.11','ovn2.11']
UpgradeLeappToInstall: ['openvswitch2.15','ovn2.15']
LeappActorsToRemove: ['persistentnetnamesdisable']
# Ceph parameters
# As ceph-ansible 3 is kept during the whole upgrade
# but the repository will be lost after the operating

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
It may be necessary to remove specific actors from the leapp
process to unblock it if the actor inhibits the upgrade. This
facility is now available using the LeappActorsToRemove heat
parameter. The hook is role-specific to allow maximum flexibility.