Project

General

Profile

Actions

Bug #30117

closed

Iterate through all installation media/repos in provisioning templates

Added by Sven Vogel over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Templates
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Hi there,

depend on issue #27183 we whould use the following syntax since 2.X.X

<% @host.os.media.each do |media| -%>
repo --name=<%= media.name %> --baseurl=<%= @host.medium_uri(media.path) %>
<% end -%>

but this produces not the correct output.

i get e.g. the following output

url --url http://katello.example.com/pulp/repos/EWERK/Library/custom/base/7_7_1908_os_x86_64/

repo --name=epel --baseurl=http://katello.example.com/pulp/repos/EWERK/Library/custom/base/7_7_1908_os_x86_64//http://katello.example.com/pulp/repos/EWERK/Library/custom/epel/epel_7_x86_64/

i added one epel to the operating system. i get the double url. "url" and "repo" share the same part of the base url. this should not be okay i think or im not correct?

i should get only and not the base url mixed.

repo --name=epel --baseurl=http://katello.example.com/pulp/repos/EWERK/Library/custom/epel/epel_7_x86_64/

is this a bug?

Cheers

Sven


Files

Actions #1

Updated by Lukas Zapletal over 4 years ago

  • Status changed from New to Resolved

This is not the correct way, host has only one default installation media. We have implemented new array called "additional_media" host parameter. Put all additional repositories in there, we ship bits in our teplates which render it correctly. This works even for Katello.


app/views/unattended/provisioning_templates/provision/preseed_default.erb
104:<% @additional_media.each do |medium| -%>

app/views/unattended/provisioning_templates/provision/kickstart_default.erb
77:<% @additional_media.each do |medium| -%>

Actions #3

Updated by Sven Vogel over 4 years ago

Hi Lukas,

solved this how you wrote and found an useful link in the forum. https://community.theforeman.org/t/centos-8-provisioning-how-does-additional-media-get-populated/17424/2

the host parameter needs to be added like this

additional_media string [{"name":"EPEL","url":"http://katello.example.com/pulp/repos/EXAMPLE/Library/custom/epel/epel_7_x86_64/"}]

thanks for help

Actions

Also available in: Atom PDF