Removed GPG key, but not on hosts in redhat.repo

I removed a GPG-key in the “content credentials” and it is also no more configured in the “product” it was assigned to it.
However, on the hosts, in /etc/yum.repo.d/redhat.repo, for the repositories for that product, the gpgkey is still pointing to the URL of the removed GPG-key and gpgcheck is enabled.
Now we are unable to install packages from these repositories as it (of course) can’t find the GPG-key.

I already executed subscription-manager refresh, as well a forced new subscription-manager register, but it remains in the file!

Expected outcome:

I would have expected that the GPG-config for these repositories for that product would have been changed in the redhat.repo on the hosts.

Foreman and Proxy versions:

Foreman version 2.0.1
Katello version 3.15.3

Foreman and Proxy plugin versions:

Distribution and version:

CentOS Linux release 7.8.2003 (Core)

Other relevant data:

I solved this as follow:

  • re-created the Content-credential
  • assigned the gpg-key back to the product
  • removed the gpg-key from the repositories in that product
  • ‘subscription-manager refresh’ now removed the gpgkey is removed fron the redhat.rep and gpgcheck is now disabled
  • removed the gpg-key from the product
  • removed the gpg-key from the content credentials

So it seems like that the initial remove of the content credential did not removed it automatically from the repositories.