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

Add candlepin repositories for Katello staging #1743

Merged
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
2 changes: 2 additions & 0 deletions roles/candlepin_repositories/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
candlepin_repositories_version: '4.3'
16 changes: 16 additions & 0 deletions roles/candlepin_repositories/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
Comment on lines +10 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically this is not required as people will enabled katello:el8 which pulls that in?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I will leave it there so you can use candlepin standalone.

6 changes: 2 additions & 4 deletions roles/forklift_versions/library/forklift_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,15 @@ 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:
possible_versions = set()
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

# 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))
Expand Down
2 changes: 2 additions & 0 deletions roles/forklift_versions/molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions roles/katello_repositories/tasks/staging_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions vagrant/config/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ installers:

- foreman: '3.9'
katello: '4.11'
candlepin: '4.3'
pulpcore: '3.39'
puppet: 7
boxes:
Expand All @@ -75,6 +76,7 @@ installers:

- foreman: 'nightly'
katello: 'nightly'
candlepin: '4.3'
pulpcore: '3.39'
puppet: 7
boxes:
Expand Down
Loading