Problem:
Hi there, I have a simple question : is it possible to automatically assign a location to a host registering on Katello via subscription-manager based on which smart proxy it used ?
As an example, I have 2 sites : ITX and AWS, I have a smart proxy for each, when I register my hosts via subscribe manager and with a smart proxy :
Expected outcome:
My host should be in the AWS location, however, it’s in the ITX one, as it’s the default one for registration
I can override where it’s registered by putting a file like that
@loitho Hey, thanks for writing in! You can set a default location using the Default location setting in the Puppet tab under Settings, but this is globally scoped, so not sure if it will be exactly what you are looking for.
I think you may find the bootstrap script helpful, it looks like it can control Location as well.
I saw the default_location value, what I’m trying to achieve is just to be able to have the smart proxy location applied to the host registering himself on foreman through the smart proxy.
I would like the “default_location” to be “same as smart proxy used for registration” if that makes sense.
The bootstrap script is quite nice, but in my environment it doesn’t quite works, I’m better simply using the subscription-manager command.
I’ll just update the location.facts file accordingly
+1 on this topic.
If it is not possible to set default location based on which smart proxy server subscribed is it possible to do so based on activation key used?
Thank you