Project

General

Profile

Actions

Bug #30325

open

Host groups not filtered on selected location

Added by Danny Van de Pol over 4 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

I'm a bit surprised this hasn't been flagged before (unless my searches were inadequate):
if I set a location in the GUI and navigate to Configure - Host Groups, the list of host groups always shows all groups, regardless of the location they are assigned to (unlike e.g. Discovery Rules).

Actions #1

Updated by Danny Van de Pol over 4 years ago

Likewise, when provisioning a host, after setting a location the host group dropdown menu shows all host groups instead of just the ones belonging to the selected location.

Actions #2

Updated by Aditi Puntambekar over 4 years ago

I am able to see this behaviour in case of Default Location only and no other Location.

Steps I followed:
1. Create a location, say "Temp Loc".
2. Create an HG, say "test_hg" and assign "Temp Loc" to this HG.
3. Now, select Default Location, I can see "test_hg" even when  it's not assigned to "Default Location".
4. Now, create another location, say "Testing Loc" and do not assign your HG to it.
5. Now, select "Testing Loc", I do not see the HG in the list.

Could you try to check if the same happens for you?

Actions #3

Updated by Danny Van de Pol over 4 years ago

Well, I figured it out. I guess with 'Default location' you mean 'Any location' ?

Anyway - turned out that in the Host Groups settings for my location, the checkbox 'All host groups' had been checked, that explains of course. I guess my co-admin might have done that for some reason, doesn't really matter. Once I unchecked it and removed all host groups not belonging to my location, things turned to normal.

In some way I find this inconsistent: if you edit a host group and set only one or some specific locations, that setting is overridden by that checkbox but it isn't shown. Imho once that checkbox has been activated, editing a host group should show it in all locations and it should not be possible to remove any (an indication why they can't be removed might be useful).

That explains why nobody noticed before ;-) - my apologies for wasting your time.

Actions #4

Updated by Bernhard Suttner over 2 years ago

I have a similar issue. I think, it has the same root cause.

Use Case 1:
- A Location Loc1 exists, which has "All Host Groups" (Administer > Locations -> Loc1 -> Host groups) activated
Select "Any Location" in the Taxanomy Location selection
- Create a new HostGroup HG1 without assigning a Location.
- If you visit "Administer > Locations > Loc1 > Host groups" again, HG1 is in the selected host group column
- If you visit the Hostgroup HG1 itself and go to "Locations", no Location is selected.
=> Mismatch!

Use Case 2:
- A Host group HG1 exists without a selected Location
- Select "Any Location" in the Taxanomy Location selection
- Create a new Location Loc1.
- If you visit "Administer > Locations > Loc1 > Host groups" again, HG1 is in the selected host group column
- If you visit the Hostgroup HG1 itself and go to "Locations", no Location is selected.
=> Mismatch!

It looks like, "All host groups" is always activated and can not be adapted via hammer and ansible roles / API.

Actions

Also available in: Atom PDF