From ba8b010d6c859dc88206ee3389c621eacbce9914 Mon Sep 17 00:00:00 2001 From: "Jesse Pretorius (odyssey4me)" Date: Thu, 22 Jul 2021 13:29:28 +0100 Subject: [PATCH] [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 --- .../tripleo-packages-baremetal-puppet.yaml | 17 +++++++++++++++++ environments/lifecycle/upgrade-converge.yaml | 1 + environments/lifecycle/upgrade-prepare.yaml | 1 + .../LeappActorsToRemove-0238894e48aebbef.yaml | 7 +++++++ 4 files changed, 26 insertions(+) create mode 100644 releasenotes/notes/LeappActorsToRemove-0238894e48aebbef.yaml diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index da393a6fc5..741e5abd6a 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -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 diff --git a/environments/lifecycle/upgrade-converge.yaml b/environments/lifecycle/upgrade-converge.yaml index de6928d422..e2f3b0a781 100644 --- a/environments/lifecycle/upgrade-converge.yaml +++ b/environments/lifecycle/upgrade-converge.yaml @@ -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 diff --git a/environments/lifecycle/upgrade-prepare.yaml b/environments/lifecycle/upgrade-prepare.yaml index d2ad43df9c..e20955b459 100644 --- a/environments/lifecycle/upgrade-prepare.yaml +++ b/environments/lifecycle/upgrade-prepare.yaml @@ -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 diff --git a/releasenotes/notes/LeappActorsToRemove-0238894e48aebbef.yaml b/releasenotes/notes/LeappActorsToRemove-0238894e48aebbef.yaml new file mode 100644 index 0000000000..ad115687dc --- /dev/null +++ b/releasenotes/notes/LeappActorsToRemove-0238894e48aebbef.yaml @@ -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.