Katello 4.9 Custom products changes with SCA

I manage to enable custom repo on my AK with by removing the subscription part of my playbook then switch the content_overrides part to enabling wanted repos instead of disabling unwanted one.

Now when i register new host, custom repos are well enabled by AK

1 Like

So the whole point of SCA is that you no longer need to provide subscriptions on activation keys.

However, if you change the activation key, you’ll need to force re-register all systems that use it :slight_smile:

That’s what I do in my Ansible playbooks (or, depending on the host, I just reinstall the whole OS, sometimes that’s less work :innocent:)

Activation keys have always only affected hosts at registration time. I don’t see how subscriptions make a difference there?

They shouldn’t as far as I know, if you’re using SCA. I also forgot to mention you can also ‘just’ enable the repo with subscription-manager repos --enable=<your repo label here>

So I made another workaround in my Ansible role that I use to manage RHSM on client systems.

Bottom line is, the following:

- name: 'Configure repos'
  community.general.rhsm_repositories:
    name: '*'
    state: 'enabled'

This will enable all repos provided by the ActivationKey on your system. If you only want a specific list and remove the rest, check out the docs for the purge option of this module :slight_smile:

If you are doing this for all hosts registering with that activation key, you can override the repos to enabled on the key itself, rather than the hosts.

Yes, that’s true, however, the Ansible code for configuring this on AKs doesn’t take wildcards (and the API itself also not AFAIK), whereas this logic is already a part of subscription-manager.

That’s why it does work as an alternative for me :slight_smile:

1 Like