From c1180541fa127361ef28e3e1384c8903252eeb2c Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 7 Dec 2023 14:05:27 +0100 Subject: [PATCH 1/2] Remove a hack for non-EL8 Katello --- roles/forklift_versions/library/forklift_versions.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/roles/forklift_versions/library/forklift_versions.py b/roles/forklift_versions/library/forklift_versions.py index b53d59212..1035bc33e 100644 --- a/roles/forklift_versions/library/forklift_versions.py +++ b/roles/forklift_versions/library/forklift_versions.py @@ -93,10 +93,6 @@ def main(): for version in reversed(versions['installers']): if not scenario_os in version['boxes']: continue - # this is a hack, to be removed once all Katello versions support EL8 in the same manner Foreman does - # aka: when 4.4 is released - if scenario == 'katello' and (scenario_os.startswith('centos8') or scenario_os.startswith('almalinux8')) and version_sort_key(version[scenario]) < version_sort_key('4.0'): - continue if version_sort_key(version[scenario]) <= version_sort_key(scenario_version): possible_versions.add(version[scenario]) possible_versions = list(sorted(possible_versions, key=version_sort_key, reverse=True)) From ae685c5f2d67c23c85d6930c9ade00c8312b9234 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 7 Dec 2023 14:13:20 +0100 Subject: [PATCH 2/2] Add real Candlepin repositories for Katello staging Candlepin now has its own release cycle and we'l always use the real repositories. The version is now tracked in versions.yaml, just like Pulpcore. --- roles/candlepin_repositories/defaults/main.yml | 2 ++ roles/candlepin_repositories/tasks/main.yml | 16 ++++++++++++++++ .../library/forklift_versions.py | 2 ++ .../molecule/default/verify.yml | 2 ++ .../tasks/_stagingyum_staging_repos.yml | 9 --------- .../katello_repositories/tasks/staging_repos.yml | 6 ++++++ vagrant/config/versions.yaml | 2 ++ 7 files changed, 30 insertions(+), 9 deletions(-) create mode 100644 roles/candlepin_repositories/defaults/main.yml create mode 100644 roles/candlepin_repositories/tasks/main.yml diff --git a/roles/candlepin_repositories/defaults/main.yml b/roles/candlepin_repositories/defaults/main.yml new file mode 100644 index 000000000..2f099db7b --- /dev/null +++ b/roles/candlepin_repositories/defaults/main.yml @@ -0,0 +1,2 @@ +--- +candlepin_repositories_version: '4.3' diff --git a/roles/candlepin_repositories/tasks/main.yml b/roles/candlepin_repositories/tasks/main.yml new file mode 100644 index 000000000..296f6c9ba --- /dev/null +++ b/roles/candlepin_repositories/tasks/main.yml @@ -0,0 +1,16 @@ +--- +- name: "Add Candlepin {{ candlepin_repositories_version }} repository" + yum_repository: + name: candlepin-repository + description: Candlepin {{ candlepin_repositories_version }} + baseurl: "https://yum.theforeman.org/candlepin/{{ candlepin_repositories_version }}/el{{ ansible_distribution_major_version }}/$basearch/" + gpgcheck: no + enabled: yes + +- name: 'Enable pki-core module' + command: dnf module enable -y pki-core + # can't use the `dnf` module for modules without a default stream + # https://github.com/ansible/ansible/issues/56504 + # https://github.com/ansible/ansible/issues/64852 + args: + creates: /etc/dnf/modules.d/pki-core.module diff --git a/roles/forklift_versions/library/forklift_versions.py b/roles/forklift_versions/library/forklift_versions.py index 1035bc33e..18993335f 100644 --- a/roles/forklift_versions/library/forklift_versions.py +++ b/roles/forklift_versions/library/forklift_versions.py @@ -86,6 +86,8 @@ def main(): 'foreman_puppet_repositories_version': version['puppet'], 'pulpcore_repositories_version': version['pulpcore'], } + if 'candlepin' in version: + forklift_vars['candlepin_repositories_version'] = version['candlepin'] ret = forklift_vars break else: diff --git a/roles/forklift_versions/molecule/default/verify.yml b/roles/forklift_versions/molecule/default/verify.yml index ae48a5a75..77a76c4a0 100644 --- a/roles/forklift_versions/molecule/default/verify.yml +++ b/roles/forklift_versions/molecule/default/verify.yml @@ -22,6 +22,7 @@ - foreman_repositories_version == '3.6' - katello_repositories_version == '4.8' - pulpcore_repositories_version == '3.22' + - candlepin_repositories_version is not defined - name: "Include forklift_versions for 4.4 installs" include_role: @@ -50,6 +51,7 @@ - foreman_repositories_version is defined - katello_repositories_version is defined - pulpcore_repositories_version is defined + - candlepin_repositories_version is defined - name: "Include forklift_versions for upgrades" include_role: diff --git a/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml b/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml index 265ea8641..9aa9152bf 100644 --- a/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml +++ b/roles/katello_repositories/tasks/_stagingyum_staging_repos.yml @@ -7,12 +7,3 @@ gpgcheck: no tags: - packages - -- name: 'Candlepin {{ katello_repositories_version }} Staging repository' - yum_repository: - name: candlepin-staging - description: "Candlepin {{ katello_repositories_version }} Staging Repository" - baseurl: "https://stagingyum.theforeman.org/candlepin/{{ katello_repositories_version }}/el{{ ansible_distribution_major_version }}/x86_64/" - gpgcheck: no - tags: - - packages diff --git a/roles/katello_repositories/tasks/staging_repos.yml b/roles/katello_repositories/tasks/staging_repos.yml index 8b3d9d0ab..364f75604 100644 --- a/roles/katello_repositories/tasks/staging_repos.yml +++ b/roles/katello_repositories/tasks/staging_repos.yml @@ -21,3 +21,9 @@ - name: 'Add Pulpcore repository' include_role: name: pulpcore_repositories + +- name: 'Add Candlepin repository' + include_role: + name: candlepin_repositories + when: + - candlepin_repositories_version is defined diff --git a/vagrant/config/versions.yaml b/vagrant/config/versions.yaml index c3b909521..6f31d3e2b 100644 --- a/vagrant/config/versions.yaml +++ b/vagrant/config/versions.yaml @@ -65,6 +65,7 @@ installers: - foreman: '3.9' katello: '4.11' + candlepin: '4.3' pulpcore: '3.39' puppet: 7 boxes: @@ -75,6 +76,7 @@ installers: - foreman: 'nightly' katello: 'nightly' + candlepin: '4.3' pulpcore: '3.39' puppet: 7 boxes: