Bug #26533
openDiscovery Rule vs Hostgroup taxonomies
Description
Currently, discovery rule needs to have exactly the same 1:1 organisations/locations associated as the associated hostgroup.
While trying to create a discovery rule not meeting this condition, Foreman errors out with something like this:
ERROR app : Failed to save: Locations Host group location some-loc must also be associated to the discovery rule
There was some reasoning behind it: https://projects.theforeman.org/issues/19662.
Now, please take this scenario:
- hostgroup X assigned to locations A, B
- user Y assigned to location A
- user Y creates discovery rule Z pointing to hostgroup X
- ERROR, because user Y does not belong to B (cannot assign and generally has no idea about it)
Wouldn't it be enough if discovery rule Z existed in a subset of hostgroup X taxonomies?
Discovery determines hosts org/loc by subnet (well in a typical case, as described in https://theforeman.org/plugins/foreman_discovery/14.0/index.html#3.1.3OrganizationsandLocations). Then, the rules from determined org/loc are potentially applied by priority + matching expression.
Is my thinking correct?
Thank you.