Specify additional media to install extra packages from a different repository then the mirror

Problem:
I’m using the ‘Preseed default’ provision template to install a Debian stretch host. I have specified a mirror in the preseed configuration file, and it is all working fine! But… Now I would like to add an additional repository, which I will use to install additional packages. In the ‘Preseed default’ provision template, I found an ‘APT setup’ section, where also additional media can be added (see code below). But where can I specify additional media in the GUI (or configuration file)? I know that I can specify the installation media per operating system, but where can I specify an additional medium (name, url, gpg key, etc)?

Expected outcome:
Added additional media to the apt sources.list so extra packages can be installed (from a different repository then the specified mirror)

Foreman and Proxy versions:
Foreman 1.20.1

Other relevant data:
<% @additional_media.each do medium -%>
d-i apt-setup/local<%= repos %>/repository string <%= medium[:url] %> <%= @host.operatingsystem.release_name %>-<%= medium[:name] %> main
<%= “d-i apt-setup/local#{repos}/comment string #{medium[:comment]}” if medium[:comment] %>
<%= “d-i apt-setup/local#{repos}/key string #{medium[:gpgkey]}” if medium[:gpgkey] %>
<% repos +=1 -%>
<% end -%>

This feature was actually added not long ago, and should become available in 1.21.
For now I can share the PR that actually added it, in the comments there are instructions for how to use it: https://github.com/theforeman/foreman/pull/6166

1 Like