diff --git a/README.md b/README.md index b037973..c4fb6bf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/app/views/foreman_leapp/job_templates/leapp_preupgrade.erb b/app/views/foreman_leapp/job_templates/leapp_preupgrade.erb index c180435..5b3ba01 100644 --- a/app/views/foreman_leapp/job_templates/leapp_preupgrade.erb +++ b/app/views/foreman_leapp/job_templates/leapp_preupgrade.erb @@ -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 diff --git a/app/views/foreman_leapp/job_templates/leapp_upgrade.erb b/app/views/foreman_leapp/job_templates/leapp_upgrade.erb index 47954a8..3e7d0ee 100644 --- a/app/views/foreman_leapp/job_templates/leapp_upgrade.erb +++ b/app/views/foreman_leapp/job_templates/leapp_upgrade.erb @@ -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 @@ -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: