Enable a new repo to already registred hosts

Problem:
I recently switch to SCA, then upgrade to Foreman 3.7 / Katello 4.9
The upgrade process automatically apply overrides so my existing customs products are ok.
SCA have been much discussed, so I am not sure how to enable a new repo (Foreman client 3.7) to my existing hosts.
I added the repo to my AK as Enabled (overridden). Newly registred host are getting the setting from the but not the ones already registred (unless I force a new registration).
So what is the correct way to enable this repo to all existing hosts ?
I have read about the “manage repository sets” in the content host page. Shoud I do this action every time I had a new repo?

Expected outcome:
New repo enabled on the wanted hosts

Foreman and Proxy versions:
Foreman 3.7 Katello 4.9

Foreman and Proxy plugin versions:

Name Version
foreman-tasks 8.1.1
foreman_bootdisk 21.0.4
foreman_puppet 6.0.0
foreman_remote_execution 10.0.7
katello 4.9.2
puppetdb_foreman 6.0.2

Distribution and version:
OracleLinux 8.8

If the hosts are subscribed to a content view, just add it to the content view and when published the clients will see it.

They see it in “subscription-manager repos” but not enabled.
The status sets in the activation key has no effect on my existings hosts. :roll_eyes:

Correct. Starting with 4.9 new repositories of custom products are disabled by default. To enable it, you have set a override to enabled for each host, which needs it.

Set it on activation keys to enable it for new hosts registering with that key. Changing the activation key does not change hosts which have already been registered using that key.

You can also set overrides with subscription-manager on the hosts, if you want.

I am not sure why you would want to add a new repository to a product and enable this repository immediately on ALL existing hosts. Can you elaborate, where you think you’ll need that?

It makes sense

My products are specifically dedicated to an OS version(CentOS 7 , Oracle Linux 8, OL9 etc…) and a content-view to manage version publication.
So after upgrading Foreman, I deploy the new Foreman-client repo to them.

Exactly. So you don’t want to enable the new repositories on all hosts, but only the hosts which are actually supposed to use them. There is no point enabling the el7 foreman-client repository on your el8 or el9 hosts, even if your content view makes sure to match the repo with the os major version.

Thus, if there is a new version of foreman, you’ll add three foreman-client repositories (el7,el8,el9) and then enable el7 on all el7 hosts, el8 on all el8 hosts, and so forth.

Enabling all three on all hosts doesn’t really make sense and it also prevents you from ever switching a host to Library environment without content view, which I find quite useful to see what new rpms are there before they ever get into a content view.

If you added the oracle linux kvm/utils repository for ol9 to your foreman server you wouldn’t want to enable that on all your hosts including centos7 and ol8 either, wouldn’t you?

I haven’t been clear, of course I enable the matching repo and OSes with my AK/Products/CV strategy.

Thanks for your answer.

Getting back to the original question: You can manage content overrides for existing hosts (without re-registering) from Hosts > Content Hosts. Select the host(s) you want to change and then Select Action > Manage Repository sets.

1 Like

I am having this same issue on Foreman 3.15.0 / Katello 4.17.1.

Our Foreman / Katello system uses SCA. I have a new content view that I have added to the composite content view used by our linux servers. I have set the new product under the Repository Set of the Activation keys for the OS to Enabled (overridden). I also tried to set a specific host to add the new repo in redhat.repo file by Going to Content Hosts > Manage Repository Set to “Override to Enabled”. I have also run “subscription-manager refresh” on the server. However, nothing is adding the new repo to redhat.repo. In addition, I have run subscription-manager refresh, and restarted rhsmcertd. Nothing works. How can I get this new repo added to the redhat.repo file? Before SCA, I could just attach the pool id and it would just
work.

What repo is it?

First, ensure that the CCV and CV have both been published after adding the repo.

If it’s a RHEL repo, does your RHEL version match? Does the repo have a release version that matches that of the host?

If it’s custom, is the Restrict to OS Version or Architecture feature in use on the repo? (That only works with RHEL, so will always hide the repo if you have a non-RHEL Enterprise Linux.)

These are the only things I know that can cause the repo not to be added to redhat.repo.

Also check your system clock and make sure that’s correct.

Perfect, that was the issue. It is a custom repo, and I did have the OS Version restricted. After removing that, and doing a subscription-manager refresh, the repo is now showing in the redhat.repo file.

Thank you for your help!

1 Like