Skip to content

Commit

Permalink
Fixes SAT-24133 Convert2RHEL: deprecated functionality
Browse files Browse the repository at this point in the history
- RPM is not installed for version 2.0.0
- Removed keep-rhsm flag
  • Loading branch information
stejskalleos authored and nofaralfasi committed Apr 30, 2024
1 parent 611edf4 commit 8c6be4f
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app/views/foreman_ansible/job_templates/convert_to_rhel.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ template_inputs:
options: "yes\r\nno"
advanced: false
value_type: plain
resource_type: Katello::ActivationKey
hidden_value: false
model: JobTemplate
job_category: Convert 2 RHEL
Expand All @@ -33,12 +32,27 @@ kind: job_template
ansible.builtin.package:
name: convert2rhel
state: present

- name: Gather package facts
package_facts:
manager: auto

- name: Set fact for package version
set_fact:
convert2rhel_version: "{{ ansible_facts.packages['convert2rhel'][0].version }}"
when: "'convert2rhel' in ansible_facts.packages"
no_log: true

- name: Prepopulate katello-ca-consumer
get_url:
url: <%= subscription_manager_configuration_url(@host) %>
dest: /usr/share/convert2rhel/subscription-manager/katello-ca-consumer-latest.noarch.rpm
when:
- "convert2rhel_version is version('2.0.0', '<')"

- name: Start convert2rhel
command: convert2rhel -y --activationkey "<%= input_resource('Activation Key').name %>" --org "<%= @host.organization.label %>" --keep-rhsm
command: convert2rhel -y --activationkey "<%= input_resource('Activation Key').name %>" --org "<%= @host.organization.label %>"

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

0 comments on commit 8c6be4f

Please sign in to comment.