Skip to content

Commit

Permalink
fix 36666 - Add support for "channel" parameter
Browse files Browse the repository at this point in the history
This commit introduce the possibility to pass the "channel" parameter to
leapp, so during an upgrade can be targetted release 8.6 EUS, even if
source is 7.9 "plain".

ref. https://projects.theforeman.org/issues/36666
  • Loading branch information
andreamtp committed Nov 3, 2023
1 parent acfade5 commit 91d9655
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ The plugin will add following jobs:
- Remediation plan
- Run upgrade via Leapp

### Channel

Leapp by default will use the same "channel" (EUS, AUS, E4S) as the current OS, so if you are using EUS repos, the target OS will be on EUS repos as well.
But if you are upgrading and want to target a different channel, i.e. from a RHEL 7.9 to a RHEL 8.6 EUS, you can do it by explicitely setting the "channel" to EUS.

The "channel" have to be specified in both the preupgrade and upgrade jobs: by default the value is "none", so regular repositories will be used.

## Api
- `GET /api/preupgrade_reports` List Preupgrade reports
- `GET /api/preupgrade_reports/:id` Show Preupgrade report
Expand Down
10 changes: 9 additions & 1 deletion app/views/foreman_leapp/job_templates/leapp_preupgrade.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ description_format: 'Upgradeability check for RHEL host'
provider_type: SSH
feature: leapp_preupgrade
model: JobTemplate
template_inputs:
- name: Channel
description: Set if the target OS is required to use any Extended Upgrade Support (EUS), Advanced Update Support (AUS), Update Services for SAP Solutions (E4S) repository or none.
input_type: user
required: true
default: "none"
options: "none\neus\naus\ne4s"
%>
<%= render_template 'Check Leapp' %>

rm -f /var/log/leapp/leapp-report.json
leapp preupgrade
<% channel_opts = input('Channel') == 'None' ? '' : "--channel #{input('Channel')}" %>
leapp preupgrade <%= channel_opts %>

echo "===leap_upgrade_report_start==="
cat /var/log/leapp/leapp-report.json
10 changes: 9 additions & 1 deletion app/views/foreman_leapp/job_templates/leapp_upgrade.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ provider_type: Ansible
feature: leapp_upgrade
model: JobTemplate
template_inputs:
- name: Channel
description: Set if the target OS is required to use any Extended Upgrade Support (EUS), Advanced Update Support (AUS), Update Services for SAP Solutions (E4S) repository or none.
input_type: user
required: true
default: "none"
options: "none\neus\naus\ne4s"
- name: Reboot
description: Reboot the host automaticaly to continue with the upgrade
input_type: user
Expand All @@ -18,7 +24,9 @@ template_inputs:
- hosts: all
tasks:
- name: Run Leapp Upgrade
command: leapp upgrade
% channel_opts = input('Channel') == 'none' ? '' : "--channel #{input('Channel')}" %>
command: leapp preupgrade <%= channel_opts %>
<%- if input('Reboot') == "true" -%>
- name: Reboot the machine
reboot:
Expand Down

0 comments on commit 91d9655

Please sign in to comment.