Problem:
We have an automated script-based process that creates new hosts and registers them with our Foreman server with subscription-manager. The details are handled by Chef, so there is no manual intervention needed when we spin up a host. The problem is that every new host we create gets dumped into the content view Default Organization View, and ends up with the wrong package repositories. We have three other content views set up (one each for CentOS, Alma Linux, and Fedora), but after the host shows up in Foreman we need to manually move it from Default Organization View to the correct one.
I’ve tried editing Default Organization View with hammer to give it a better set of repositories, but I’m told that “The default content view cannot be edited, published, or deleted.”
Apparently there’s no subscription-manager command for setting content view.
Is there a way we can automate which content view a new host gets assigned to when it first connects to Foreman?
Foreman and Proxy versions:
Foreman 3.4
Foreman and Proxy plugin versions:
Katello 4.6
rubygem-hammer_cli 3.4
Distribution and version:
Alma Linux 8.7