From 9afe811ef41b2118b9ec938367aefe6af818454e Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Thu, 23 Apr 2020 17:10:42 +0200 Subject: [PATCH] Enable adding packages into Leapp's to_remove/to_install files. Leapp enables removal and installing packages during the leapp upgrade, so that the change takes effect during the machines reboot. This patch adds a mechanism to configure that list of packages via two new heat parameters: UpgradeLeappToInstall and UpgradeLeappToRemove. Also, as part of the upgrade from Queens to Train, there is a big jump in the openvswitch versions, having ovs2.11 in Queens and ovs2.13 in Train, which are mutually exclusive. This package adds these two pacakges into the to_remove/ to_install mechanism so that the openvswitch package upgrade takes place during Leapps reboot to upgrade the Operating System. Change-Id: I2d07f19da68dd17b74189f273e75af3fe1d7a955 --- .../tripleo-packages-baremetal-puppet.yaml | 28 +++++++++++++++++-- environments/lifecycle/upgrade-prepare.yaml | 2 ++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml index 8c896c6664..511b131bc4 100644 --- a/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml +++ b/deployment/tripleo-packages/tripleo-packages-baremetal-puppet.yaml @@ -69,6 +69,14 @@ parameters: description: Timeout (seconds) for the OS upgrade phase via Leapp type: number default: 1800 + UpgradeLeappToRemove: + default: [] + description: List of packages to remove during Leapp upgrade. + type: comma_delimited_list + UpgradeLeappToInstall: + default: [] + description: List of packages to install after Leapp upgrade. + type: comma_delimited_list UpgradeInitCommand: type: string description: | @@ -112,7 +120,9 @@ outputs: - never - system_upgrade - system_upgrade_prepare - when: step|int == 3 + when: + - step|int == 3 + - upgrade_leapp_enabled block: - name: remove all OpenStack packages shell: | @@ -124,12 +134,24 @@ outputs: -python2-jinja2 \ -python2-markupsafe \ -python2-six - when: upgrade_leapp_enabled - name: install leapp package: name: leapp state: latest - when: upgrade_leapp_enabled + - name: "add packages into Leapp's to_remove file" + vars: + pkg_to_remove: { get_param: UpgradeLeappToRemove } + lineinfile: + path: "/etc/leapp/transaction/to_remove" + line: "{{ item }}" + loop: "{{ pkg_to_remove }}" + - name: "add packages into Leapp's to_install file" + vars: + pkg_to_install: { get_param: UpgradeLeappToInstall } + lineinfile: + path: "/etc/leapp/transaction/to_install" + line: "{{ item }}" + loop: "{{ pkg_to_install }}" - name: system_upgrade_prepare step 4 tags: diff --git a/environments/lifecycle/upgrade-prepare.yaml b/environments/lifecycle/upgrade-prepare.yaml index 1b99e46693..2255988964 100644 --- a/environments/lifecycle/upgrade-prepare.yaml +++ b/environments/lifecycle/upgrade-prepare.yaml @@ -11,6 +11,8 @@ parameter_defaults: EnablePackageInstall: true ServerDeletionPolicy: retain UpgradeLevelNovaCompute: auto + UpgradeLeappToRemove: ['openvswitch2.11','ovn2.11'] + UpgradeLeappToInstall: ['openvswitch2.13','ovn2.13'] UpgradeInitCommonCommand: | #!/bin/bash set -eu