Skip to content

Commit

Permalink
Make Satellite Activation Key use optional. (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmcutter authored Jun 20, 2023
1 parent 6f37c24 commit 7b34548
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 11 deletions.
8 changes: 5 additions & 3 deletions roles/analysis/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ leapp_preupg_opts: "{{ '--no-rhsm' if leapp_upgrade_type == 'rhui' else '' }}"
# Note that there is a different leapp data file for RHEL 7.6 for IBM POWER 9 (little endian) or IBM Z (structure A) architectures.
leapp_metadata_url: https://satellite.example.com/pub/leapp-data-21.tar.gz

satellite_organization: Example
satellite_activation_key_pre_leapp: rhel{{ ansible_distribution_major_version }}
satellite_activation_key_leapp: rhel{{ ansible_distribution_major_version }}_leapp
# Satellite Organization and Activation Keys are required if using Satellite to change content views
# unless the content view already in use has all required repositories.
# satellite_organization: Example
# satellite_activation_key_pre_leapp: rhel{{ ansible_distribution_major_version }}
# satellite_activation_key_leapp: rhel{{ ansible_distribution_major_version }}_leapp

leapp_repos_enabled: []
# leapp_repos_enabled:
Expand Down
5 changes: 4 additions & 1 deletion roles/analysis/tasks/analysis-leapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
org_id: "{{ satellite_organization }}"
force_register: true
notify: Register to pre leapp activation key
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_leapp is defined

- name: Install packages for preupgrade analysis on RHEL 7
ansible.builtin.package:
Expand Down
5 changes: 4 additions & 1 deletion roles/analysis/tasks/analysis-preupg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
--org="{{ satellite_organization }}"
--activationkey="{{ satellite_activation_key_pre_leapp }}"
--force
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_pre_leapp is defined
notify: Register to pre leapp activation key RHEL 6
register: sub_man_reg
failed_when: false
Expand Down
6 changes: 4 additions & 2 deletions roles/upgrade/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ leapp_repos_enabled: []

rhel_7_network_install_repo_url: http://capsule1.example.com/pub/ISO/RHEL7.9

satellite_organization: Example
satellite_activation_key_post_leapp: rhel{{ ansible_distribution_major_version }}_prod
# Satellite Organization and Activation Keys are required if using Satellite to change content views
# unless the content view already in use has all required repositories.
# satellite_organization: Example
# satellite_activation_key_post_leapp: rhel{{ ansible_distribution_major_version }}_prod

# Desired selinux mode post Leapp upgrade.
# selinux_mode: enforcing
Expand Down
5 changes: 4 additions & 1 deletion roles/upgrade/tasks/leapp-post-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@
activationkey: "{{ satellite_activation_key_post_leapp }}"
org_id: "{{ satellite_organization }}"
force_register: true
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_post_leapp is defined

- name: Include update-and-reboot.yml
ansible.builtin.include_tasks: update-and-reboot.yml
Expand Down
5 changes: 4 additions & 1 deletion roles/upgrade/tasks/leapp-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
activationkey: "{{ satellite_activation_key_leapp }}"
org_id: "{{ satellite_organization }}"
force_register: true
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_leapp is defined

- name: Include update-and-reboot.yml
ansible.builtin.include_tasks: update-and-reboot.yml
Expand Down
5 changes: 4 additions & 1 deletion roles/upgrade/tasks/redhat-upgrade-tool-post-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
--activationkey="{{ satellite_activation_key_post_leapp }}"
--force
register: sub_man_reg
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_post_leapp is defined
failed_when: false

- name: Include check-for-old-packages.yml
Expand Down
5 changes: 4 additions & 1 deletion roles/upgrade/tasks/redhat-upgrade-tool-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
activationkey: "{{ satellite_activation_key_leapp }}"
force_register: true
register: sub_man_reg
when: leapp_upgrade_type == 'satellite'
when:
- leapp_upgrade_type == 'satellite'
- satellite_organization is defined
- satellite_activation_key_leapp is defined
failed_when: false

- name: Gather package facts
Expand Down

0 comments on commit 7b34548

Please sign in to comment.