We use Cloudformation to build out our instances in AWS. In the template we define the activation key to use which gets executed by Cloud-Init. All this works fine. We further break down all our hosts into 3 different patching groups. Many releases ago of foreman there were ways to link a Host Collection to an Activation Key but no longer. What I would like to do but not sure this is possible is to pass the patching group name through Cloud-Init to Subscription Manager and then into Foreman. If I can get it this far I can then have a cron job or a Foreman job run looking for the variable. If found add the host to a Host Collection group.
If there is a better way to do something like this I am all for it too.