-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fixes #36579 - Split the installer into multiple subpackages #9564
base: rpm/develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,3 +1,7 @@ | ||||||||||
%global configdir %{_datadir}/%{name}/config | ||||||||||
%global parser_cache %{_datadir}/%{name}/parser_cache | ||||||||||
%global scenariodir %{_sysconfdir}/%{name}/scenarios.d | ||||||||||
|
||||||||||
%global release 1 | ||||||||||
%global prereleasesource develop | ||||||||||
%global prerelease %{?prereleasesource} | ||||||||||
|
@@ -7,44 +11,80 @@ Epoch: 1 | |||||||||
Version: 3.12.0 | ||||||||||
Release: %{?prerelease:0.}%{release}%{?prerelease:.}%{?prerelease}%{?nightly}%{?dist} | ||||||||||
Summary: Puppet-based installer for The Foreman | ||||||||||
Group: Applications/System | ||||||||||
License: GPLv3+ and ASL 2.0 | ||||||||||
URL: https://theforeman.org | ||||||||||
Source0: https://downloads.theforeman.org/%{name}/%{name}-%{version}%{?prerelease:-}%{?prerelease}.tar.bz2 | ||||||||||
|
||||||||||
BuildArch: noarch | ||||||||||
|
||||||||||
Requires: curl | ||||||||||
Requires: hostname | ||||||||||
Requires: puppet-agent >= 7.0.0 | ||||||||||
Requires: rubygem(kafo) >= 7.3.0 | ||||||||||
Requires: rubygem(kafo) < 8.0.0 | ||||||||||
Requires: ruby(release) | ||||||||||
# As a migration foreman-installer ensures the foreman scenario is installed | ||||||||||
Requires: %{name}-scenario-foreman = %{epoch}:%{version}-%{release} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this should allow users to not get the foreman scenario if they already have something katello-ish |
||||||||||
|
||||||||||
BuildRequires: asciidoc | ||||||||||
BuildRequires: puppet-agent >= 7.0.0 | ||||||||||
BuildRequires: rubygem(rake) | ||||||||||
BuildRequires: rubygem(kafo) >= 7.3.0 | ||||||||||
BuildRequires: rubygem(kafo) < 8.0.0 | ||||||||||
BuildRequires: puppet-agent-puppet-strings >= 1.2.0 | ||||||||||
BuildRequires: puppet-agent-puppet-strings < 5 | ||||||||||
BuildRequires: puppet-agent-puppet-strings >= 1.2.0 | ||||||||||
BuildRequires: rubygem(kafo) < 8.0.0 | ||||||||||
BuildRequires: rubygem(kafo) >= 7.3.0 | ||||||||||
BuildRequires: rubygem(rake) | ||||||||||
|
||||||||||
%description | ||||||||||
Complete installer for The Foreman life-cycle management system based on Puppet. | ||||||||||
|
||||||||||
%package katello | ||||||||||
Summary: Katello installer bits | ||||||||||
Group: Applications/System | ||||||||||
Provides: katello-installer-base < 3.11.0-1 | ||||||||||
Obsoletes: katello-installer-base < 3.11.0-1 | ||||||||||
%package common | ||||||||||
Summary: Common installer bits | ||||||||||
|
||||||||||
Requires: curl | ||||||||||
Requires: hostname | ||||||||||
Requires: puppet-agent >= 6.15.0 | ||||||||||
Requires: ruby(release) | ||||||||||
Requires: rubygem(kafo) < 8.0.0 | ||||||||||
Requires: rubygem(kafo) >= 6.5.0 | ||||||||||
Requires: which | ||||||||||
|
||||||||||
Requires: %{name} = %{epoch}:%{version}-%{release} | ||||||||||
%description common | ||||||||||
The common parts to all installer scenarios. | ||||||||||
|
||||||||||
%package katello-common | ||||||||||
Summary: Common Katello installer bits | ||||||||||
|
||||||||||
Requires: %{name}-common = %{epoch}:%{version}-%{release} | ||||||||||
Requires: openssl | ||||||||||
Requires: katello-certs-tools | ||||||||||
Requires: which | ||||||||||
|
||||||||||
%description katello-common | ||||||||||
All the parts needed for both both the Katello and Foreman Proxy Content | ||||||||||
scenarios. | ||||||||||
|
||||||||||
%package katello | ||||||||||
Summary: Deprecated package that installs both Katello scenarios | ||||||||||
|
||||||||||
Requires: foreman-installer-scenario-katello = %{epoch}:%{version}-%{release} | ||||||||||
Requires: foreman-installer-scenario-foreman-proxy-content = %{epoch}:%{version}-%{release} | ||||||||||
Comment on lines
+62
to
+63
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
but I am not sure those two would cancel themself out and you'd end with a weird result? |
||||||||||
|
||||||||||
%description katello | ||||||||||
Various scenarios and tools for the Katello ecosystem | ||||||||||
Transitional meta package | ||||||||||
|
||||||||||
%package scenario-foreman | ||||||||||
Summary: Foreman scenario | ||||||||||
Requires: foreman-installer-common = %{epoch}:%{version}-%{release} | ||||||||||
|
||||||||||
%description scenario-foreman | ||||||||||
Foreman | ||||||||||
|
||||||||||
%package scenario-katello | ||||||||||
Summary: Foreman and Katello scenario | ||||||||||
Requires: foreman-installer-katello-common = %{epoch}:%{version}-%{release} | ||||||||||
|
||||||||||
%description scenario-katello | ||||||||||
Foreman with Katello. | ||||||||||
|
||||||||||
%package scenario-foreman-proxy-content | ||||||||||
Summary: Foreman Proxy Content scenario | ||||||||||
Requires: foreman-installer-katello-common = %{epoch}:%{version}-%{release} | ||||||||||
|
||||||||||
%description scenario-foreman-proxy-content | ||||||||||
A content proxy for Katello. | ||||||||||
|
||||||||||
%prep | ||||||||||
%setup -q -n %{name}-%{version}%{?prerelease:-}%{?prerelease} | ||||||||||
|
@@ -66,61 +106,64 @@ rake install \ | |||||||||
SYSCONFDIR=%{buildroot}%{_sysconfdir} \ | ||||||||||
--trace | ||||||||||
|
||||||||||
%post | ||||||||||
%post scenario-foreman | ||||||||||
foreman-installer --scenario foreman --migrations-only > /dev/null | ||||||||||
|
||||||||||
%post katello | ||||||||||
foreman-installer --scenario foreman-proxy-content --migrations-only > /dev/null | ||||||||||
%post scenario-katello | ||||||||||
foreman-installer --scenario katello --migrations-only > /dev/null | ||||||||||
|
||||||||||
%files | ||||||||||
%post scenario-foreman-proxy-content | ||||||||||
foreman-installer --scenario foreman-proxy-content --migrations-only > /dev/null | ||||||||||
|
||||||||||
%files common | ||||||||||
%defattr(-,root,root,-) | ||||||||||
%doc README.* | ||||||||||
%license LICENSE | ||||||||||
%dir %{_sysconfdir}/%{name} | ||||||||||
%config(noreplace) %{_sysconfdir}/%{name}/custom-hiera.yaml | ||||||||||
%dir %{_sysconfdir}/%{name}/scenarios.d | ||||||||||
%{_sysconfdir}/%{name}/scenarios.d/foreman.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/foreman.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/foreman-answers.yaml | ||||||||||
%config(noreplace) %{_sysconfdir}/%{name}/scenarios.d/foreman-migrations-applied | ||||||||||
%dir %{scenariodir} | ||||||||||
%{_sbindir}/%{name} | ||||||||||
%{_datadir}/%{name} | ||||||||||
%{_mandir}/man8 | ||||||||||
|
||||||||||
# katello files | ||||||||||
%exclude %{_datadir}/%{name}/config/foreman-proxy-content* | ||||||||||
%exclude %{_datadir}/%{name}/config/katello* | ||||||||||
%exclude %{_datadir}/%{name}/katello-certs | ||||||||||
%exclude %{_datadir}/%{name}/parser_cache/foreman-proxy-certs.yaml | ||||||||||
%exclude %{_datadir}/%{name}/parser_cache/foreman-proxy-content.yaml | ||||||||||
%exclude %{_datadir}/%{name}/parser_cache/katello.yaml | ||||||||||
|
||||||||||
%files katello | ||||||||||
# common | ||||||||||
%dir %{_datadir}/%{name} | ||||||||||
%{_datadir}/%{name}/checks | ||||||||||
%dir %{_datadir}/%{name}/config | ||||||||||
%{_datadir}/%{name}/config/config_header.txt | ||||||||||
%{_datadir}/%{name}/config/foreman-hiera.yaml | ||||||||||
%{_datadir}/%{name}/config/foreman.hiera | ||||||||||
%{_datadir}/%{name}/hooks | ||||||||||
%{_datadir}/%{name}/modules | ||||||||||
%{_datadir}/%{name}/VERSION | ||||||||||
%dir %{parser_cache} | ||||||||||
%{_mandir}/man8/%{name}.8* | ||||||||||
|
||||||||||
%files katello-common | ||||||||||
%{_sbindir}/katello-certs-check | ||||||||||
|
||||||||||
# foreman-proxy-content scenario | ||||||||||
%{_datadir}/%{name}/config/foreman-proxy-content* | ||||||||||
%{_datadir}/%{name}/parser_cache/foreman-proxy-content.yaml | ||||||||||
%{_sysconfdir}/%{name}/scenarios.d/foreman-proxy-content.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/foreman-proxy-content.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/foreman-proxy-content-answers.yaml | ||||||||||
%config(noreplace) %{_sysconfdir}/%{name}/scenarios.d/foreman-proxy-content-migrations-applied | ||||||||||
|
||||||||||
# katello scenario | ||||||||||
%{_datadir}/%{name}/config/katello* | ||||||||||
%{_datadir}/%{name}/parser_cache/katello.yaml | ||||||||||
%{_sysconfdir}/%{name}/scenarios.d/katello.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/katello.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{_sysconfdir}/%{name}/scenarios.d/katello-answers.yaml | ||||||||||
%config(noreplace) %{_sysconfdir}/%{name}/scenarios.d/katello-migrations-applied | ||||||||||
%files scenario-foreman | ||||||||||
%{configdir}/foreman.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/foreman.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/foreman-answers.yaml | ||||||||||
%config(noreplace) %{scenariodir}/foreman-migrations-applied | ||||||||||
%{parser_cache}/foreman.yaml | ||||||||||
Comment on lines
+142
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could become a macro There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to write a macro but couldn't make it work. There's a good chance that's on my side but RPM documentation was insufficient. |
||||||||||
|
||||||||||
%files scenario-katello | ||||||||||
%{configdir}/katello.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/katello.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/katello-answers.yaml | ||||||||||
%config(noreplace) %{scenariodir}/katello-migrations-applied | ||||||||||
%{parser_cache}/katello.yaml | ||||||||||
|
||||||||||
# foreman-proxy-certs-generate | ||||||||||
%{_datadir}/%{name}/katello-certs | ||||||||||
%{_datadir}/%{name}/parser_cache/foreman-proxy-certs.yaml | ||||||||||
%{parser_cache}/foreman-proxy-certs.yaml | ||||||||||
%{_sbindir}/foreman-proxy-certs-generate | ||||||||||
|
||||||||||
%files scenario-foreman-proxy-content | ||||||||||
%{configdir}/foreman-proxy-content.migrations | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/foreman-proxy-content.yaml | ||||||||||
%config(noreplace) %attr(600, root, root) %{scenariodir}/foreman-proxy-content-answers.yaml | ||||||||||
%config(noreplace) %{scenariodir}/foreman-proxy-content-migrations-applied | ||||||||||
%{parser_cache}/foreman-proxy-content.yaml | ||||||||||
|
||||||||||
%changelog | ||||||||||
* Wed May 22 2024 Zach Huntington-Meath <[email protected]> - 1:3.12.0-0.1.develop | ||||||||||
- Bump version to 3.12-develop | ||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two options/questions:
foreman-installer-foreman
Obsoleteforeman-installer
and avoid this?foreman-installer
become the common package rather than a-common
sub-package?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that, but I don't think you can do that.
Perhaps
foreman-installer-scenario
can have:And that could replace it. I'm never sure so would need to test it out. But I think then we can't have a foreman-installer package.
I just realized we need a similar solution for katello, but there we may need to pull in both katello and foreman-proxy-content scenarios to remain compatible.
Yes, but then I fear we can't do the migration well. Perhaps we can list them as soft dependencies with Suggests, but I really don't trust that if I'm honest. Especially if we take downstream into account.
@evgeni any more ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard no on "Suggests", that implies the package would work without the "suggested" one, but I don't think the installer will without the common bits ;-)
Can you elaborate more on your fear wrt "foreman-installer" is the "common" package? My brain suggests it should work, but its also partially in PTO mode.
And for me, to recap the plan and whether I understood it correctly:
foreman-installer-scenario-<thing>
and that would make things work as neededforeman-installer-scenario-foreman
and would still not have to pass--scenario
and things will work as beforeforeman-installer-scenario-katello
ANDforeman-installer-scenario-fpc
(as we don't know, package wise, what they have deployed) and will have multiple scenarios available as before (but as they already installed, they don't need to pass--scenario
anymore)foreman-installer-scenario-<thing>
) andObsolete
them with the "right"<thing>
packageOne thing to consider: I know that we use the "is
foreman-installer-katello
installed" fact to differentiate between foreman and katello installs in a few places (like LEAPP), so we gotta go hunting for those and update them :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we will modify the installation instructions. I also hope to introduce foreman-installer-scenario-foreman-proxy to provide a non-content proxy so there would be consistency.
Correct. I hope to get to a point where
dnf upgrade
will ensureforeman-installer-scenario-foreman
is installed when they now haveforeman-installer
installed.Correct, and because they have
foreman-installer
installed they will also getforeman-installer-scenario-foreman
which they also don't need. Perhaps rich dependencies could help here.In
foreman_maintain
we can suggest cleanups by looking at the symlink which scenario is active, but that's not going to work in plain dnf.Correct. As above,
satellite-maintain
can suggest redundant packages. Though it depends on how much we want to patch downstream. In downstream we havesatellite
andcapsule
meta packages which could do the migration as well.I don't see it show up in foreman_maintain. As for LEAPP: do we still support that? We don't support skipping over releases and we dropped EL7 a while back so by the time they get here, they should already be on EL8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking ahead when we will do LEAPP for 8 to 9, reusing the code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like your optimism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking basically, the fact Satellite has meta packages to represent each type means they can require the respective scenario package and do the cleanup.
In all cases, we will know what scenario is installed on the system, and can use that information to do cleanup. We could consider using this as the same opportunity to move the answer files (theforeman/foreman-installer#698) but that might be scope creep. Figured I'd throw it out there as this new packaging provides an opportunity to signal other changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is something I also thought about. I mostly worry about the additional tooling that reads it, such as foreman_maintain. Perhaps we should provide a way to output the answers, like some script or some installer output option.