Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36666 - Add support for "channel" parameter #130

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ The plugin will add following jobs:
- Remediation plan
- Run upgrade via Leapp

### Channel

Leapp by default will use the same "channel" (e4s, eus, aus) as the current OS, so if you are using "eus" repositories, the target OS will be on "eus" repositories 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.
Default value of "channel" is "ga" - General availability: regular repositories are used by default.

## Api
- `GET /api/preupgrade_reports` List Preupgrade reports
- `GET /api/preupgrade_reports/:id` Show Preupgrade report
Expand Down
12 changes: 11 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,22 @@ 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 the General Availability (GA) channel - the default - or a specific channel among: Update Services for SAP Solutions (E4S), Extended Upgrade Support (EUS) or Advanced Update Support (AUS)."
input_type: user
required: true
default: "ga"
options: "ga\ne4s\neus\naus"
%>
<%
channel_opts = input('Channel') == 'ga' ? '' : "--channel #{input('Channel')}"
%>

<%= render_template 'Check Leapp' %>

rm -f /var/log/leapp/leapp-report.json
leapp preupgrade
leapp preupgrade <%= channel_opts %>

echo "===leap_upgrade_report_start==="
cat /var/log/leapp/leapp-report.json
11 changes: 10 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 the General Availability (GA) channel - the default - or a specific channel among: Update Services for SAP Solutions (E4S), Extended Upgrade Support (EUS) or Advanced Update Support (AUS)."
input_type: user
required: true
default: "ga"
options: "ga\ne4s\neus\naus"
- name: Reboot
description: Reboot the host automaticaly to continue with the upgrade
input_type: user
Expand All @@ -16,9 +22,12 @@ template_inputs:
%>
---
- hosts: all
vars:
- channel_opts: <% input('Channel') == 'ga' ? '' : "--channel #{input('Channel')}" %>
tasks:
- name: Run Leapp Upgrade
command: leapp upgrade
command: leapp upgrade {{ channel_opts }}

<%- if input('Reboot') == "true" -%>
- name: Reboot the machine
reboot:
Expand Down