How to disable subscription by default

Problem:
I added EPEL Centos 7 repository to content view and activation key, I’ve set it in activation key to override to disabled and new activations get it disabled but existing one get repository as enabled.

How can I disabled it by default or set it on all existing ones to disabled by override?

I was looking into API PUT /api/hosts/:host_id/subscriptions/content_override
but i don’t understand how to correctly pass the update data.

Foreman and Proxy versions:
Foreman 1.20
Foreman and Proxy plugin versions:
katello-3.10
Distribution and version:
Centos 7.7

Hi and welcome to the forum :slight_smile:

The reason why it is not disabled by default on your existing nodes ist because activation-keys are only evaluated during a subscription-manager register. Changing the activation key after registration will not affect any hosts that are already registred.
TBH, I am not sure if it’s possible to set a new repo to disabled by default für existing hosts.

Luckily, there are several options for you:

  • The one you already mentioned, API endpoint /api/hosts/:host_id/subscriptions/content_override. How the data needs to be passed to that, I don’t know either, though. :frowning:
  • Using hammer host subscription content-override
    Fore RedHat products, there is an additional UI way (I was pretty sure this worked for custom products, too. Obviously it does not)
  • From the UI, go to Hosts -> Content Hosts -> select all the hosts you want to disable the repo on via checkbox (or use the “select all” checkbox) -> Click “Select Action” -> Manage Repository sets

I hope this helps :slight_smile:

Regards

3 Likes