Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1740414 - hammer host [create or update] --ansible-roles "role-name" assigns all roles available in satellite
Summary: hammer host [create or update] --ansible-roles "role-name" assigns all roles ...
Keywords:
Status: CLOSED DUPLICATE of bug 1851415
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible - Configuration Management
Version: 6.4
Hardware: All
OS: All
high
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Danny Synk
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-12 21:30 UTC by roarora
Modified: 2021-06-08 09:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-08 09:53:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28298 0 Normal New hammer host [create or update] --ansible-roles "role-name" assigns all available roles 2020-10-12 15:25:25 UTC

Description roarora 2019-08-12 21:30:52 UTC
Description of problem:

When assigning ansible roles while creating a host via hammer with "--ansible-roles" option, all available roles in satellite are assigned to the system


Version-Release number of selected component (if applicable):
6.4
6.5

How reproducible:
Always

Steps to Reproduce:

1. Import some ansible roles in satellite and assign while creating a host with 
hammer

# hammer host create --ansible-roles test --name client --hostgroup RHEL7 --location city --organization Example
 
In background, it calls following API to get role IDs but it gives result containing all ansible roles :
---------------------------------
/ansible/api/ansible_roles?name=test"
---------------------------------

API SHould have been : 

---------------------------------
/ansible/api/ansible_roles?search=name=test"
---------------------------------


Actual results:
All roles in satellite are assigned to the system

Expected results:

Only roles which are passed in the hammer command should be assigned

Additional info:

Behaviour is same with "hammer host update --ansible-roles" also

Comment 3 Ondřej Pražák 2019-11-19 10:01:43 UTC
Created redmine issue https://projects.theforeman.org/issues/28298 from this bug

Comment 4 Bryan Kearney 2021-06-07 15:44:36 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/28298 has been resolved.

Comment 5 Tomer Brisker 2021-06-08 09:53:33 UTC

*** This bug has been marked as a duplicate of bug 1851415 ***


Note You need to log in before you can comment on or make changes to this bug.