CentOS 8 install fails missing "../../../AppStream" repo when Installation Media is foreman repo.
"pulp/repos/ORG/Library/custom/CentOS8/base-x86_64" somehow goes to:
#3 Updated by Alexander von Gluck IV about 1 year ago
- Priority changed from Normal to High
- Subject changed from CentOS 8 PXE install fails missing "AppStream" repo to CentOS 8 install fails missing "../../../AppStream" repo when Installation Media is foreman repo.
This is going to be a painful one folks. Adjusting Subject as we learned more about it. CentOS folks are saying it's a foreman problem. Since the BaseOS repo references ../../../ , it goes above the Product name, making any kind of "aliases" too vague.
A work around seems to be setting your installation media to the upstream CentOS repositories vs the local ones. however since that relative path is in the repo definitions... updates will fail as well.
#4 Updated by James Shewey about 1 year ago
It's a really ugly hack, but you can use an Apache rewrite to work around this. I was able to add a rewrite rule to /etc/httpd/conf.d/pulp_rpm.conf and set the /pulp/repos/ Location to:
<VirtualHost *:80> ServerName hostname.domain.com ## Vhost docroot DocumentRoot "/usr/share/foreman/public" ## Directories, there should at least be a declaration for /usr/share/foreman/public <IfModule mod_rewrite.c> RewriteEngine on RewriteRule (.*)/AppStream/x86_64/os/repodata/(.*) $1/custom/CentOS_8/CentOS_8_-_Base/repodata/$2 [R] </IfModule>
This works successfully, and I was able to kickstart my install but isn't very generalizable as a fix because the path will differ for each deployment.
#7 Updated by Ian Ballou about 1 year ago
I've just tested this and provisioning CentOS 8 works if the Appstream repo is sent to Anaconda. The related code is here: https://github.com/Katello/katello/blob/master/app/services/katello/managed_content_medium_provider.rb#L19
To get it work I created an "AppStream" repo (http://mirror.centos.org/centos-8/8/AppStream/x86_64/os/) in the same lifecycle environment and content view as my CentOS 8 repo and synced it. Then, after host creation, I checked that my kickstart file mentioned AppStream (like `repo --name AppStream --baseurl http://foreman-nuc1.example.com/pulp/repos/Demo/Library/custom/CentOS/AppStream/`). That should be done automatically.
I'll update our provisioning documentation to include this scenario.
#9 Updated by Matthew LeSieur about 1 year ago
I was able to successfully provision a CentOS 8 host from Satellite 6.5 with your suggestion of adding the "AppStream" repository to the provisioning template. As it turns out, the default template "Kickstart default" already includes code that specifies the additional repository, except the name is not "AppStream" (the repository name below, "centos-8-appstream-x86_64", is site specific).
<%= @mediapath %><%= proxy_string %> <% @additional_media.each do |medium| -%> repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %> <% end -%>
Rendered template snippet:
url --url http://satellite.example.com/pulp/repos/Example_Organization/Example_Lifecycle/centos-linux-8-standard/custom/centos-linux/centos-8-release-x86_64/ repo --name centos-8-appstream-x86_64 --baseurl http://satellite.example.com/pulp/repos/Example_Organization/Example_Lifecycle/centos-linux-8-standard/custom/centos-linux/centos-8-appstream-x86_64/
I had to update the template to change the name of the repository to "AppStream" (I know the code below is not ideal, but it works for this specific case):
<%= @mediapath %><%= proxy_string %> <% @additional_media.each do |medium| -%> <% if (@host.operatingsystem.name == 'CentOS_Linux' and os_major >= 8) -%> repo --name AppStream --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %> <% else -%> repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %> <% end -%> <% end -%>
Rendered template snippet:
url --url http://satellite.example.com/pulp/repos/Example_Organization/Example_Lifecycle/centos-linux-8-standard/custom/centos-linux/centos-8-release-x86_64/ repo --name AppStream --baseurl http://satellite.example.com/pulp/repos/Example_Organization/Example_Lifecycle/centos-linux-8-standard/custom/centos-linux/centos-8-appstream-x86_64/
I do not think the problem is Foreman/Satellite in this case, I think CentOS Anaconda should be updated to allow other repository names. RHEL 8 hosts install correctly with the additional media set to something other than "AppStream", so I do not see why CentOS should be any different.
#10 Updated by Ian Ballou about 1 year ago
Hey Matthew, thanks for the detailed info there on getting provisioning working with different naming. I agree that the real bug here is with CentOS 8 & Anaconda. In the meantime, we'll direct people to either change the AppStream repo name or to edit the existing provisioning template / make a new one specific for CentOS 8.
#13 Updated by Ian Ballou 9 months ago
- Status changed from New to Closed
Related documentation can be found here: https://theforeman.org/plugins/katello/3.13/user_guide/provisioning/index.html