Script to use Hammer for enabling all available Red Hat repository sets

Posted on

Just as a starting point to managing repository sets across multiple Organizations, I would like to see a script that uses Hammer to just enable all available Red Hat repository sets.

I know that I can NOT enable a Red Hat repository set without all of the following information in Hammer, as a for-instance:

hammer repository-set enable --organization your-org --product unknown-product --basearch "x86_64" --releasever "6Server" --name "Red Hat Software Collections RPMs for Red Hat Enterprise Linux 6 Server"

The struggle seems to be that using Hammer you must enable each repository set, but yet you must already know what Product that is, what ARCHs are available, what releasever to select, and also the specific name (well you would at least need the name.)

I'd like to see a script that just takes a provided Organization name and enables all available Red Hat repository-sets just to see if it can be done. I would be able to trim it down from there to just the ones we are needing.

If I could manage this across multiple Organizations within the Web UI I would do that, however I've not seen any way to do this.