Bug 2094912

Summary: Unable to search the hosts based on the query "ansible_role", if the roles are inherited from the hostgroup.
Product: Red Hat Satellite Reporter: Gourav Padholia <gpadholi>
Component: HostsAssignee: nalfassi
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: afeferku, apatel, aruzicka, inecas, kgaikwad, mhulan, nalfassi
Target Milestone: 6.13.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-03 13:21:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gourav Padholia 2022-06-08 15:39:20 UTC
Description of problem:
Search the hosts by running the query "ansible_role = role_name" does not lists the hosts if the roles are inherited from the hostgroup. 

Version-Release number of selected component (if applicable):
Satellite 6.10

How reproducible:
100 %

Steps to Reproduce:
1. Go to Hostgroup -> Create host group and Add roles in the Ansible roles tab.
2. Go to Hosts -> Select Hosts -> Edit Host -> Assign the hotgroup and verify that the roles are ansible inherited from the hostgroup. 
3. Go to Satellite web UI -> Hosts -> All Hosts and search the host "ansible_role = role_name"

Actual results:
The query doesn't list the hosts having the roles assigned. 

Expected results:
It should list all the hosts, even if the roles are inherited from the host groups. 

Additional info:

Comment 2 Marek Hulan 2022-08-22 12:58:29 UTC
Nofar, is this now possible thanks to https://projects.theforeman.org/issues/27181?

Comment 3 nalfassi 2022-08-22 13:17:29 UTC
(In reply to Marek Hulan from comment #2)
> Nofar, is this now possible thanks to
> https://projects.theforeman.org/issues/27181?

Yes, that is correct.
Thanks to these last changes, now you search a hostgroup by its ansible roles.
Thank you for noticing it!

Comment 4 nalfassi 2022-08-25 12:55:07 UTC
The fix for this issue would be added on Satellite 6.13, since it was recently merged. If someone wants this fix in earlier versions please let me know.

Comment 5 Brad Buckingham 2022-12-16 19:23:45 UTC
Aligning to 6.13 as this as been confirmed to be in SNAP 3 with rubygem-foreman_ansible-10.1.0-1.el8sat.noarch.

Comment 7 Peter Ondrejka 2023-01-09 15:33:11 UTC
Verified on Satellite 6.13 snap 5, hosts can now be searched using inherited ansible roles

Comment 10 errata-xmlrpc 2023-05-03 13:21:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097