Subscriptions for temporary systems

Latest response

We perform automated package install testing for our product on RHEL. As our packages prereq a number of other packages, we have to subscribe the temporary tests systems (we use docker), run the installation tests, then unsubscribe.

subscription-manager register --username={XXX} --password={YYY} --force --name=tmp-{rhel-version}-packagetest --auto-attach
We then unregister at the end of the test with:
subscription-manager unregister

We recently discovered over 100 of these subscriptions lying around - I'm guessing because of some infrastructure failures that caused the 'unregister' not to happen.

I had hoped that the --name and --force options would make the subscription manager overwrite/replace an existing subscription with the same name, but that does not seem to be the case.

Can anyone suggest how to make the subscription manager overwrite an existing 'named' subscription, make subscriptions that auto-self delete after 1 hour (the tests only take a few minutes), or some other way in which our docker containers can register, install some packages, but then definitely not hang around once the container has been deleted?

Responses