Satellite cannot provisioning CentOS 8 Server

@iballou so I created CentOS 8 product, added both BaseOS and AppStream repos, synced both, created a host and it rendered this:

url --url http://katello.nat.lan/pulp/repos/MyOrg/Library/custom/CentOS8/CentOS8-BaseOS/
repo --name CentOS8-AppStream-KS --baseurl http://katello.nat.lan/pulp/repos/MyOrg/Library/custom/CentOS8/CentOS8-AppStream-KS/ 

However it does not work. Is there something I am missing here? I mean, I don’t need the alias hack if we add a secondary repository with the required content, do I?

katello-3.14.0

@mcorr once I get this working I will definitely prepare some content

1 Like

@lzap the issue is your AppStream repo isn’t literally named ‘AppStream’. The alias workaround from above shouldn’t be needed. And I’ll note that the template workaround in our provisioning documentation is there in case people need to have AppStream be named something else in Katello, but if you start with “AppStream” as a name to start you shouldn’t need that either.

1 Like

Also I’ll mention that if you have to do anything more than follow the provisioning instructions to get this to work then there has indeed been some sort of regression since I wrote them. For the people who are still having troubles, I’m not clear if those instructions were used.

Give this a shot if you still haven’t got it working:

/etc/httpd/conf.d/pulp_aliases.conf

Alias /pulp/repos/MyOrg/Library/BaseOS/x86_64/os /var/www/pub/yum/http/repos/MyOrg/Library/custom/CentOS8/CentOS8-BaseOS
Alias /pulp/repos/MyOrg/Library/AppStream/x86_64/os /var/www/pub/yum/http/repos/MyOrg/Library/custom/CentOS8/CentOS8-AppStream-KS
Alias /pulp/repos/MyOrg/Library/centosplus/x86_64/os /var/www/pub/yum/http/repos/MyOrg/Library/custom/CentOS8/CentOS8-centosplus
Alias /pulp/repos/MyOrg/Library/Extras/x86_64/os /var/www/pub/yum/http/repos/MyOrg/Library/custom/CentOS8/CentOS8-Extras
Alias /pulp/repos/MyOrg/Library/PowerTools/x86_64/os /var/www/pub/yum/http/repos/MyOrg/Library/custom/CentOS8/CentOS-PowerTools

I’m taking a stab in the dark at how your aliases would need to be configured based on the limited information I can extract as to how your repos, etc. are named.

You can always grep the 404 errors from your /var/log/httpd/foreman_access.log with something like:

grep -oP ‘(?<=GET ).Library.(?=/repodata/repomd.xml HTTP/1.[12]" 404)’ /var/log/httpd/foreman_access.log| sort -u

Those directories that are returned by that command are the ones you’ll need to create the appropriate aliases for.

The grep command I placed above was reformatted by the website so I’m trying to fix it here:

grep -oP ‘(?<=GET ).*Library.*(?=/repodata/repomd.xml HTTP/1.[12]" 404)’ /var/log/httpd/foreman_access.log | sort -u

That fixed the asterisks but the single quotes are still being altered so make sure if grep gives you a syntax error that you replace the single quotes manually.

Nope. Is there a reason why we don’t ship this automatic repository id renaming? I think it would be very useful:

In fact, if this gets into develop I will want to backport this into 2.0.

1 Like

I was hoping this Anaconda bug would be temporary, but it looks like it 's going to stick around. I think having it in the community templates is a good idea.

Is the solution using the pulp aliasing the best way to resolve this issue?
In a previously post I’ve said that the solution of @Mkbrown was ok and it was really so… but now I cannot anymore provisioning CentOS 8. It is really strange…For this reason I ask me if this solution still ok .

@hiero-nymus, the best way to resolve this issue is to use the special CentOS 8 instructions on our provisioning guide (Foreman :: Plugin Manuals). If you don’t want to name your AppStream repo “AppStream”, you could also try adding in the kickstart template changes that @lzap mentioned above in his community templates PR.

If you’re still having troubles, could you paste us your rendered kickstart template? I would like to see if you have a repo --name ... line for your AppStream repo and if it has the correct naming.

1 Like

@iballou Thanks for you reply. I followed instructions as described in URL and it was running for about one week before. For this reason I don’t understand this issue.

Please here’s my kickstart template portion:
<%= @mediapath %><%= proxy_string %>
<% @additional_media.each do |medium| -%>
<% if (medium[:url].include?(“AppStream”) and @host.operatingsystem.name == ‘CentOS’ and os_major >= 8) -%>
repo --name AppStream --baseurl <%= medium[:url] %>
<% else -%>
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ’ --install’ : ‘’ %><%= proxy_string %>
<% end -%>
<% end %>
<% end %>
lang <%= host_param(‘lang’) || ‘en_US.UTF-8’ %>
selinux --<%= host_param(‘selinux-mode’) || host_param(‘selinux’) || ‘enforcing’ %>
keyboard <%= host_param(‘keyboard’) || ‘us’ %>
skipx

Here’re my repo:

ID    | NAME                          | PRODUCT  | CONTENT TYPE | URL                                                   
------|-------------------------------|----------|--------------|---------------------------------------------------------------------------------
10498 | AppStream                     | CentOS 8 | yum          | http://mirror.centos.org/centos-8/8/AppStream/x86_64/kickstart/
10200 | CentOS 8 AppStream            | CentOS 8 | yum          | http://mirror.centos.org/centos/8/AppStream/x86_64/os 
10427 | CentOS 8 AppStream kickstart  | CentOS 8 | yum          | http://mirror.centos.org/centos/8/AppStream/x86_64/kickstart/
10199 | CentOS 8 BaseOS               | CentOS 8 | yum          | http://mirror.centos.org/centos/8/BaseOS/x86_64/os    
10202 | CentOS 8 centosplus           | CentOS 8 | yum          | http://mirror.centos.org/centos/8/centosplus/x86_64/os
10198 | CentOS 8 Extras               | CentOS 8 | yum          | http://mirror.centos.org/centos/8/extras/x86_64/os    
10426 | CentOS 8 kickstart            | CentOS 8 | yum          | http://mirror.centos.org/centos/8/BaseOS/x86_64/kickstart/
10201 | CentOS 8 PowerTools           | CentOS 8 | yum          | http://mirror.centos.org/centos/8/PowerTools/x86_64/os
------|-------------------------------|----------|--------------|---------------------------------------------------------------------------------

@hiero-nymus your kickstart template should be fine, can we see what the kickstart file looks like on a host when it is fully executed? If you navigate to your host page, click the “Templates” tab and then the arrow next to “Edit” in the “Provisioning template” row. Clicking the “Review” popup will bring you to the rendered template.

In that file I’ll be looking to see how the repo --name line rendered (and if it even did).

Ok, I’m checking this Review but I don’t see anything about AppStream nor any repo. This is really weird.

@hiero-nymus then it looks like you might not have anything in @additional_media. I’m not sure why it would have stopped working in the past week, have you created/synced/edited any more CentOS 8 related repos since then?

To see if booting CentOS 8 still works at all, you could hardcode repo --name AppStream --baseurl "Katello url for your appstream os repo" above that @additional_media line and provision again.

1 Like

Also I’m going to see if I can reproduce your issues on one of my own machines, maybe I’ll find something useful by doing so.

I confirmed at least that your provisioning template is correct, it worked out of the box for me on our latest Katello code. I’ll try again on the Katello and Foreman that correspond to your Satellite 6.6.2-1.

I tried again with Satellite 6.6 and the AppStream repo appeared correctly in the provisioning template. I didn’t actually have to edit the default provisioning template at all, it just worked.

Did you change your operating system setup at all? I have CentOS_Linux 8 that was automatically generated after syncing the CentOS 8 repos.

@iballou Thank you… No, I don’t change the setup and in this time I’ve synced new CentOS 8 repos. I’ve tried with CentOS_Linux 8 too but it was the same problem.
As you told me I’ve defined the additional_media not in kickstart but passed as variable in my Host Group and since, the installation is ok.

@hiero-nymus when you say you passed additional_media as a variable in your host group, do you mean as a host group parameter? I’m curious what you set the value to in order for it to work.

@iballou yes, I’ve configured as a parameter under Host Group. Here’s the value in attach file.

@hiero-nymus I’m glad that is working at least. I suspect that your empty additional_media is a bug, so I will get an issue going with the repo information you gave me and see if someone can reproduce it.