Use only local epel repo during provisioning

Hello,

i want to achive that installation and subscription is completely done from local repos.
For subscription manager registration i need epel repository.
So i set: epel-repo-base in the OS parameters to the local epel repo.
This is also correctly used by the epel snippet.
But the snippet downloads the epel-release-latest-7-12.noarch.rpm from local repo…and then using the internet mirror repos from the package to install…

After subscription and deleting internet repos in /etc/yum.repos.d/ the local repos are used only.

How can i achieve the problem to use only local repos during installation?

Thanks
Thomas

There’s a boolean parameter, “enable-epel” that you need to set to false to prevent provisioning of an external EPEL repository. Sounds like you have the local repo configuration down already.

1 Like

I tried this setting and it doesnt install epel packages at the beginning but i still think its going outside to install subscription-manager.
I have epel lokally synced and added to contentview but how the system gets this repo before subscription?
here the scrennshot with enable-epel = false

in the kickstart finish template it is this section:

#update local time
echo “updating system time”
yum -y install ntpdate
/usr/sbin/ntpdate -sub 0.fedora.pool.ntp.org
/usr/sbin/hwclock --systohc

echo ##############################################################
echo ################# SUBSCRIPTION MANAGER #####################
echo ##############################################################
echo
echo “Starting the subscription-manager registration process”

if [ -f /usr/bin/dnf ]; then
  dnf -y install subscription-manager
else
  yum -t -y install subscription-manager
fi

subscribtion-manager package is in the lokal updates repo but at this point of time client is not yet subscribed and so uses standard internet repo/mirror

Not sure what to tell you. Disabling “enable-repo” pretty much nailed the behavior that I’m looking for, but I’m also adding repository data to my templates for direct access to lifecycle environments as well, including access to a local EPEL repository.

1 Like

that makes sence is this also possible via standard kickstart templates and which parameter is used for this?

Is there a standard template to add own local repos via parameters?

Unfortunately, there isn’t, to the best of my knowledge (apparently, I’ve managed to not get a pull request successfully set up.). I’ve cloned & modified the standard kickstart template to add my own repos. The call to the following snippet is inserted in the template where repositories would be added. You’ll also need a parameter implemented as an array of hashes.

< %#
    kind: snippet
    name: Custom repositories
    model: 
    snippet: true
    %>

    <% if host_param("custom_repos") %>
        <% host_param("custom_repos").each do |repo| %>
    repo --name=<%= repo['name'] %> --baseurl=<%= repo['uri'] %>
        <% end %>
    <% end %>
1 Like

great have you maybe an example how the parameters looks like?

Something like…

[ {"name":"RepoName", "uri":"https:/fqdn/path/to/repo"}, 
 {"name":"Repo2", "uri": "https://fqdn2/path/to/repo2"} ]

Repeat for as many hashes as necessary.

1 Like