RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 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 "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". 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 "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-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 794882 - ipa netgroup-find --hosts=<hostname> not working
Summary: ipa netgroup-find --hosts=<hostname> not working
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Martin Prpič
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: 796244 819998
TreeView+ depends on / blocked
 
Reported: 2012-02-17 20:36 UTC by Scott Poore
Modified: 2013-05-21 12:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
With netgroups, when adding a host as a member that Identity Management does not have stored as a host already, it is considered to be an external host. This host can be controlled with netgroups, but Identity Management has no knowledge of it. Currently, there is no way to use the netgroup-find option to search for external hosts. Also, note that when host is added to a netgroup as an external host, rather than as an external host in Identity Management, that host is not automatically converted within the netgroup rule.
Clone Of:
: 796244 819998 (view as bug list)
Environment:
Last Closed: 2012-05-10 17:11:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Scott Poore 2012-02-17 20:36:02 UTC
Description of problem:

Not getting any results using --hosts with netgroup-find.

# ipa netgroup-add mytestng --desc=my_test_netgroup
-------------------------
Added netgroup "mytestng"
-------------------------
  Netgroup name: mytestng
  Description: my_test_netgroup
  NIS domain name: testrelm.com
  IPA unique ID: 4f73e57a-59a5-11e1-915e-525400c37d65

# ipa netgroup-add-member mytestng --hosts=mytesthostname
  Netgroup name: mytestng
  Description: my_test_netgroup
  NIS domain name: testrelm.com
  External host: mytesthostname
-------------------------
Number of members added 1
-------------------------

# ipa netgroup-find mytestng
------------------
1 netgroup matched
------------------
  Netgroup name: mytestng
  Description: my_test_netgroup
  NIS domain name: testrelm.com
  External host: mytesthostname
----------------------------
Number of entries returned 1
----------------------------

# ipa netgroup-find --hosts=mytesthostname
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------


Version-Release number of selected component (if applicable):
389-ds-base-1.2.10.1-1.el6.x86_64
389-ds-base-libs-1.2.10.1-1.el6.x86_64
ipa-server-2.2.0-101.20120216T0856zgitc8cdb75.el6.x86_64


How reproducible:
always?

Steps to Reproduce:
1.  <setup IPA server>
2.  kinit admin
3.  ipa netgroup-add mytestng --desc=my_test_netgroup
4.  ipa netgroup-add-member mytestng --hosts=mytesthostname
5.  ipa netgroup-find mytestng
6.  ipa netgroup-find --hosts=mytesthostname

Actual results:

last find shows this:

# ipa netgroup-find --hosts=mytesthostname
-------------------
0 netgroups matched
-------------------
----------------------------
Number of entries returned 0
----------------------------

Expected results:

I would have expected it to return the same results from Step 5 above:

# ipa netgroup-find mytestng
------------------
1 netgroup matched
------------------
  Netgroup name: mytestng
  Description: my_test_netgroup
  NIS domain name: testrelm.com
  External host: mytesthostname
----------------------------
Number of entries returned 1
----------------------------

Additional info:

/var/log/httpd/error_log entries from test:

[Fri Feb 17 14:23:53 2012] [error] ipa: INFO: admin: netgroup_add(u'mytestng', description=u'my_test_netgroup', all=False, raw=False, version=u'2.26'): SUCCESS

[Fri Feb 17 14:25:29 2012] [error] ipa: INFO: admin: netgroup_add_member(u'mytestng', all=False, raw=False, version=u'2.26', host=(u'mytesthostname',)): SUCCESS

[Fri Feb 17 14:25:39 2012] [error] ipa: INFO: admin: netgroup_find(u'mytestng', private=False, managed=False, all=False, raw=False, version=u'2.26', pkey_only=False): SUCCESS

[Fri Feb 17 14:25:50 2012] [error] ipa: INFO: admin: netgroup_find(None, private=False, managed=False, all=False, raw=False, version=u'2.26', pkey_only=False, host=(u'mytesthostname',)): SUCCESS

Comment 1 Rob Crittenden 2012-02-17 20:39:18 UTC
Ah, you're searching for external hosts. That makes a difference.

We don't currently search that. If you add an IPA host you should be able to search on that.

Comment 3 Dmitri Pal 2012-02-22 14:54:09 UTC
We need to add a tech note in 6.3. The proper fix will be delivered later.

Comment 4 Rob Crittenden 2012-04-13 19:49:02 UTC
With netgroups if you add a host as a member that IPA does not have stored as a host already it is considered to be an external host. This is a host you want to control with netgroups but IPA doesn't need to know about.

There is not a way to use netgroup-find to search for external hosts.

Note too that if a host is added to a netgroup as an external, then as a host in IPA, it is not automatically converted within the netgroup rule.

Comment 5 Martin Prpič 2012-04-15 13:06:42 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
With netgroups, when adding a host as a member that Identity Management does not have stored as a host already, it is considered to be an external host. This host can be controlled with netgroups, but Identity Management has no knowledge of it. Currently, there is no way to use the netgroup-find option to search for external hosts.
    Also, note that when host is added to a netgroup as an external host, rather than as an external host in Identity Management, that host is not automatically converted within the netgroup rule.

Comment 6 Scott Poore 2012-04-20 00:00:01 UTC
So an ldapsearch like the following is the only way to find netgroups containing external hosts in the triples?

ldapsearch -x -D "$ROOTDN" -w "$ROOTDNPWD" -b "cn=ng,cn=compat,$BASEDN" "nisNetgroupTriple=*test2.example.com*"

Does it make sense to look at this as an RFE for a new option to netgroup-find for --externalhosts maybe?


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