Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1417015

Summary: [RFE] From hammer cli, creating external user-group does not have any option --auth-source-name as a input parameter.
Product: Red Hat Satellite Reporter: Amit Kumar Das <amdas>
Component: LDAPAssignee: Dominik Hlavac Duran <dhlavacd>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2.6CC: bkearney, dhlavacd, dlobatog, jcallaha, jko, mhulan, nshaik, pa.van.der.sar, sjagtap, tstrachota
Target Milestone: 6.4.0Keywords: FutureFeature
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 15:27:25 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:
Bug Depends On:    
Bug Blocks: 260381    

Description Amit Kumar Das 2017-01-27 00:55:35 UTC
Description of problem:

In Hammer CLI, when we create external user-group, the only input parameter
available is --auth-source-id. No option available with --auth-source-name as a parameter.

#hammer user-group external create --help
Usage:
    hammer user-group external create [OPTIONS]

Options:
 --auth-source-id AUTH_SOURCE_ID ID of linked authentication source
 --name NAME                     External user group name
 --user-group USER_GROUP_NAME    Name to search by
 --user-group-id USER_GROUP_ID    
 -h, --help                      print help
 

Version-Release number of selected component (if applicable):
# rpm -qa|grep -i satellite
satellite-6.2.6-2.0.el7sat.noarch
# hammer --version
hammer (0.5.1.11)

How reproducible:

# hammer auth-source ldap list                                   
---|----------|--------|------|---------------
ID | NAME     | LDAPS? | PORT | SERVER TYPE   
---|----------|--------|------|---------------
3  | AD-AUTH  |        | 389  | AuthSourceLdap
5  | IPA-AUTH |        | 389  | AuthSourceLdap
7  | rhel-idm |        | 389  | AuthSourceLdap
---|----------|--------|------|---------------

# hammer user-group  list 
---|---------
ID | NAME    
---|---------
4  | onlyview
---|---------

# hammer user-group  external list --user-group onlyview
---|-------------|------------
ID | NAME        | AUTH SOURCE
---|-------------|------------
2  | view-access | rhel-idm   
---|-------------|------------

# hammer user-group external create --auth-source-id 7 --name view-access-1 --user-group onlyview
External user group created
# 

# hammer user-group  external list --user-group onlyview
---|---------------|------------
ID | NAME          | AUTH SOURCE
---|---------------|------------
2  | view-access   | rhel-idm   
3  | view-access-1 | rhel-idm   
---|---------------|------------

# hammer user-group external create --help
Options:
 --auth-source-id AUTH_SOURCE_ID ID of linked authentication source
 --name NAME                     External user group name
 --user-group USER_GROUP_NAME    Name to search by
 --user-group-id USER_GROUP_ID    
 -h, --help                      print help


From the above we can see there is only one option to create external user-group i.e. --auth-source-id.

No option available with --auth-source-name or --auth-source as a input parameter.

Expected results:
auth-source-name or auth-source must be available as a input parameter.


Additional info:
This makes scripting the creation of external user-groups difficult as you must first parse the auth source list to find the id.

Comment 5 Tomas Strachota 2017-03-06 13:42:45 UTC
Created redmine issue http://projects.theforeman.org/issues/18805 from this bug

Comment 9 Satellite Program 2018-02-26 11:08:14 UTC
Upstream bug assigned to dhlavacd

Comment 11 Sanket Jagtap 2018-09-21 13:08:38 UTC
Build:Satellite 6.4.0 snap22

hammer> user-group external create --name foobargroup --user-group-id 1 --auth-source IDM
External user group created.
hammer> user-group external list --user-group foobargroup
---|-------------|------------
ID | NAME        | AUTH SOURCE
---|-------------|------------
2  | foobargroup | IDM        
---|-------------|------------
hammer> auth-source list 
---|----------|--------------------
ID | NAME     | TYPE OF AUTH SOURCE
---|----------|--------------------
1  | Internal | AuthSourceInternal 
3  | IDM      | AuthSourceLdap     
---|----------|--------------------

hammer> user-group external create --help
Usage:
     user-group external create [OPTIONS]

Options:
 --auth-source AUTH_SOURCE_NAME          Name to search by
 --auth-source-id AUTH_SOURCE_ID          
 --location LOCATION_NAME                Location name
 --location-id LOCATION_ID                
 --location-title LOCATION_TITLE         Location title
 --name NAME                             External user group name
 --organization ORGANIZATION_NAME        Organization name
 --organization-id ORGANIZATION_ID       Organization ID
 --organization-title ORGANIZATION_TITLE Organization title
 --user-group USER_GROUP_NAME            Name to search by
 --user-group-id USER_GROUP_ID            
 -h, --help                              Print help

Comment 13 errata-xmlrpc 2018-10-16 15:27:25 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, 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-2018:2927