From 7866adeba05e6a843c5c5901d074f7953aa34e0c Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Tue, 16 Jul 2019 16:25:53 +0200 Subject: [PATCH] Allow the execution of leapp without RHSM subscription. There are a set of workarounds which can be executed in order skip the RHSM subscription requirement to run the Leapp tool. This patch includes an option leapp_unsubscribed, a boolean, that when setted to true enables an environment variable LEAPP_DEVEL_SKIP_RHSM which skips the subscription check. Change-Id: Ifca276dabad3c87f86681704d4fad0658c66f4b2 --- defaults/main.yml | 4 ++++ tasks/upgrade/undercloud_os_upgrade.yaml | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 2f669157..8701160f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -254,5 +254,9 @@ roles_upgrade_order: '__undefined__' # Packet loss threshold for a ping test loss_threshold: 1 +# Run leapp upgrade without RHSM subscription +# Requires workarounds being applied. +leapp_unsubscribed: false + # Leapp OS upgrade variables leapp_unregister: true diff --git a/tasks/upgrade/undercloud_os_upgrade.yaml b/tasks/upgrade/undercloud_os_upgrade.yaml index c1b0daeb..30755819 100644 --- a/tasks/upgrade/undercloud_os_upgrade.yaml +++ b/tasks/upgrade/undercloud_os_upgrade.yaml @@ -41,7 +41,7 @@ - name: Run leapp upgrade (download packages) shell: | set -o pipefail - leapp upgrade --debug 2>&1 | \ + {{ 'LEAPP_DEVEL_SKIP_RHSM=1 sudo -E' if leapp_unsubscribed|bool and upgrade_workarounds|bool }} leapp upgrade --debug 2>&1 | \ tee {{ working_dir }}/undercloud_leapp_upgrade.log - name: Reboot the undercloud @@ -50,4 +50,6 @@ - name: Unregister the node once the OS was upgraded if desired redhat_subscription: state: absent - when: leapp_unregister|bool + when: + - leapp_unregister|bool + - not leapp_unsubscribed|bool