Red Hat Bugzilla – Bug 794882
ipa netgroup-find --hosts=<hostname> not working
Last modified: 2013-05-21 08:39:48 EDT
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
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.
We need to add a tech note in 6.3. The proper fix will be delivered later.
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.
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.
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?