Bug 794882 - ipa netgroup-find --hosts=<hostname> not working
ipa netgroup-find --hosts=<hostname> not working
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ipa (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Martin Prpic
IDM QE LIST
:
Depends On:
Blocks: 796244 819998
  Show dependency treegraph
 
Reported: 2012-02-17 15:36 EST by Scott Poore
Modified: 2013-05-21 08:39 EDT (History)
4 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 796244 819998 (view as bug list)
Environment:
Last Closed: 2012-05-10 13:11:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Scott Poore 2012-02-17 15:36:02 EST
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@TESTRELM.COM: 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@TESTRELM.COM: 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@TESTRELM.COM: 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@TESTRELM.COM: 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 15:39:18 EST
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 09:54:09 EST
We need to add a tech note in 6.3. The proper fix will be delivered later.
Comment 4 Rob Crittenden 2012-04-13 15:49:02 EDT
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 Prpic 2012-04-15 09:06:42 EDT
    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-19 20:00:01 EDT
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.