Repositories need to be enabled on host or Activation Key

I understand why the repos need to be enabled. Though I do not get why “Red Hat Enterprise Linux 8 for x86_64 - Supplementary (RPMs)” from RHEL’s manifest is considered Custom when all the others are not. But regardless. My question is if I override enable the repos in my Activation Keys do I need to worry that they might get disabled some time in the future? (Assuming no human comes along and disables them or a new repo is added.)

As a side note. It would be really nice if this was a config setting to enable all the repos or set them on a host/AK level.

@Louis_Bohm Yeah, repo enablement can be confusing :slight_smile: Here’s how it works:

A repo has a default enablement of either disabled or enabled. Custom repositories are always disabled by default. Red Hat repositories (as you’ve noticed) can be either enabled or disabled by default, depending on the repository.

You can add “content overrides” to hosts or activation keys, which override the default enablement value. So if a repository is disabled by default, and you override it to Enabled on a host, it will be enabled on that host. Likewise, if you override it to Enabled on an activation key, it will be enabled on any hosts registered with that activation key.

So, the flow is: default enablement > activation key override > host override.

And no, they won’t change unless you change them. Also keep in mind, changes to activation keys will not change existing hosts that were registered. Activation keys only affect hosts at registration time.

I went through all my Activation keys and enabled the repos attached. Then got alerted by a user that the host he was working on could not download packages. I checked the Activation Key and they were enabled. I checked the Host and they were Disabled.

I am adding procedures to enable the repos on a host per host basis when a new host is added but what I saw has to be a bug.

And to make matters worse I am finding that this command does not work even though it says it does:
hammer host subscription content-override --host $HOSTNAME --override-name ‘enable’ --content-label $REPOCONTENTNAME --value 1
After I run the command I get this back:
Updated content override.

But when I look in the GUI nothing is enable.

Activation keys only affect hosts at time of registration. Adding content overrides to activation keys will not automatically add them to that activation key’s hosts.

If you want to change content overrides on hosts after they are already registered, you will have to do it at the host level.

Is that the exact command you are using? I think it should be enabled and not enable

You can also add overrides to hosts in the web UI: Hosts > Content Hosts > (select some hosts) > Select action > Manage repository sets

Too many hosts to do via the GUI I only did the few that I absolutely needed to right now. I’ll try with enabled rather than enable in a little bit.

Thank you

Using enabled seems to be working.

So from what you said previously if I have an AK that has all the repos enabled, hosts that were attached before the enablement would need to be manually enable. Hosts added after will automatically be enabled. Correct?

You don’t have to do it one host at a time. In the web UI you can do a search for hosts, such as activation_key = ak3. You can then select all the hosts that match that search, and do a bulk action to change all of them.

Correct.

While the gui is nice I like being able to do CLI. That way I can document all the commands needed to build out a Foreman server and manage it in scripts and store that in GIT.

Saved me a boat load of time when I built out new servers so I could move from Rocky 8 to Rocky 9 as the base OS. 90% of what I did was copy paste.

1 Like