Shall we error out in a template when things are not named correctly?
I have a solution for Foreman core: https://github.com/theforeman/foreman/pull/7123
Tell me what you think. Currently CentOS 8 installation is broken:
- We donāt ship a working Installation Media with foreman, the one named āCentOS mirrorā will not work.
- If itās set to
http://mirror.centos.org/centos/$major/BaseOS/$arch/kickstart/
it still does not work due to regression discussed there - Only after additional media
http://mirror.centos.org/centos/$major/AppStream/$arch/kickstart/
is added (as a host parameter) it will work.
My patch aims to solve this:
- New installation media called āCentOS 8 mirrorā is shipped (alternatively we can put some logic into Redhat operatingsystem family to change it automatically but I believe this is less confusing)
- AppStream is automatically added if redhat major is 8 or higher, URL contains āBaseOSā and AppStream repo is missing
maybe path: http://mirror.centos.org/centos/8/BaseOS/x86_64/os/ should be used there (this we use as installation mirror for centos 8, there was no need for AppStream
Is it possible to deploy a CentOS 8 machine like a CentOS 7 machine, with the workaround from
I tried it out with Katello 3.14 but I get still the package missing error. I am confused how to setup the repositories, content views and installation media stuff for CentOS 8.
@mcorr CentOS8 (RHEL8) dramatically changed setting up repositories, itās now BaseOS and AppStream separate repos instead of one. Do you remember if we have already covered this in Satellite docs? Maybe we should upstreamize this ASAP because this is repeating problem for our users.
It is mentioned here:
And also the prerequisites for every type of provisioning in the docs mentions setting up repositories if Katello plugin is installed.
It directs to the Content Management guide, which we have yet to upstreamize:
Synchronising repositories has always been handled in the Content Management sections and is listed as a prereq to provisioning.
I deployed my first CentOS8 machine with foreman.
katello-3.14.1-1.el7.noarch
foreman-1.24.1-1.el7.noarch
But I have āhard codedā the AppStream Repo in my provision template:
################################### # AppStream repo --name AppStream --baseurl http://xxxxxxx/pulp/repos/acp_main/PROD/CentOS_8_x86_64/custom/CentOS_8/AppStream_x86_64_os/ ###################################
I tried the code blocks from the manuals:
<% @additional_media.each do |medium| -%>
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ' --install' : '' %>
<% end -%>
or
<% @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' : '' %>
<% end -%>
<% end %>
but with both code blocks the AppStream Repo is missing in my provision template.
Is your operatingsystem in Foreman database really āCentosā and major 8 or higher? Thatās what the code does, probably it needs some fine tuning, it should also match āCentOSā I think.
Realized there is a relevant patch: Feature #28116: Automatically add AppStream repo next to BaseOS as additional media - Foreman
If youāre here, this may be relevant to your woes. This thread is where google sent me when I first searched for a solution to the āā¦/ā¦/ā¦/AppStream/ā problem.
https://community.theforeman.org/t/satellite-cannot-provisioning-centos-8-server/18091/16?u=oarie
For the record, there are two solution to the problem.
-
When not using Katello (Foreman Core). Foreman 2.1 (and maybe 2.0) will ship two Installation Media, one named āCentOS 8.x mirrorā that must be used for CentOS 8 and likely older versions. And one named āCentOS 7.x mirrorā which should be used for older releases. Just pick the correct media and you should be good to go as Anaconda installer automatically adds AppStream. We might rename these in the future, we have decided for these names as these are the least confusing for newcomers.
-
When using Katello, a template change was previously required for older Foreman releases but from Foreman 2.1 this is part of the standard template and no changes are needed.
I am marking this as a solution for googlers.
I decided I didnāt want to add a specific AppStream repo so I replaced the extra medium section in my kickstart template file.
replace
repo --name <%= medium[:name] %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ā --installā : āā %><%= proxy_string %>
with
if medium[:name].match(/^AppStream/)
medium_name = āAppStreamā
else
medium_name = medium[:name]
end
%>
repo --name <%= medium_name %> --baseurl <%= medium[:url] %> <%= medium[:install] ? ā --installā : āā %><%= proxy_string %>