Project

General

Profile

Actions

Bug #36568

closed

Hostgroup API controller also returns roles assigned to hosts in a host group

Added by Alexey Masolov 11 months ago. Updated 10 months ago.

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

Description

copied from BZ 2187967

API query

/api/hostgroups/HOSTGROUPID/ansible_roles

does provide different output that WebUI editing the same HostGroup in some cases. Esp. when there is a host is associated with the HG

How reproducible:
100%

Steps to Reproduce:
1. Have 2 Ansible Roles, one assigned to a HG, another to a Host
2. Assign the Host to the HostGroup
3. In WebUI, edit the HostGroup -> Ansible Roles tab
4. call /api/hostgroups/HOSTGROUPID/ansible_roles (i.e. "curl -s -u admin:password https://$(hostname -f)/api/hostgroups/1/ansible_roles")

Actual results:
3. shows just the one AG assigned to the HG
4. shows two AGs "assigned" to the HG: the right one and also the one assigned "just" to the Host

Expected results:
Align the results - I think API response should be corrected and should not output ARs assigned to Hosts (associated with the HG). Since those AGs are not (directly) associated with the HG.

Actions #1

Updated by The Foreman Bot 11 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_ansible/pull/648 added
Actions #2

Updated by The Foreman Bot 10 months ago

  • Fixed in Releases foreman_ansible-12.0.4 added
Actions #3

Updated by Alexey Masolov 10 months ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Nofar Alfassi 10 months ago

  • Fixed in Releases foreman_ansible-12.0.5 added
  • Fixed in Releases deleted (foreman_ansible-12.0.4)
Actions

Also available in: Atom PDF