Since some default values have been removed, DNS autodiscovery is broken
Fix: https://github.com/freeipa/freeipa/pull/1430
kinit
domain
xmlrpc_uri
jsonrpc_uri
$ cat /etc/ipa/default.conf [global] domain = ipa.test
$ ./freeipa.py --list
An exception occurs:
$ ./freeipa.py --list Traceback (most recent call last): File "./ansible/contrib/inventory/freeipa.py", line 95, in <module> api = initialize() File "./ansible/contrib/inventory/freeipa.py", line 18, in initialize api.finalize() File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 738, in finalize self.__do_if_not_done('load_plugins') File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 425, in __do_if_not_done getattr(self, name)() File "local/lib/python2.7/site-packages/ipalib/plugable.py", line 618, in load_plugins for package in self.packages: File "local/lib/python2.7/site-packages/ipalib/__init__.py", line 949, in packages ipaclient.remote_plugins.get_package(self), File "local/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 120, in get_package server_info = ServerInfo(api) File "local/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 26, in __init__ hostname = DNSName(api.env.server).ToASCII() AttributeError: 'Env' object has no attribute 'server'
Same behavior as 4.5.0:
$ cat /etc/ipa/default.conf [global] domain = ipa.test $ ./freeipa.py --list { "_meta": { "hostvars": { "replica.ipa.test": {}, "server.ipa.test": {} } }, "debian-servers": { "hosts": [ "server.ipa.test" ] }, "ipaservers": { "hosts": [ "server.ipa.test", "replica.ipa.test" ] } }
$ pip list|grep ipa ipaclient (4.6.2) ipalib (4.6.2) ipaplatform (4.6.2) ipapython (4.6.2)
The IPA API doesn't do DNS discovery like this. One value is required.
With ipaclient/ipalib 4.5.0, having only domain parameter defined in global section works well.
global
Isn' that https://pagure.io/freeipa/blob/master/f/ipalib/rpc.py#_875 "DNS discovery" ?
With both 4.5.X and 4.6.X, call to api._remote_plugins raise an AttributeError exception. Since 4.6.X doesn't have a default value for xmlrpc_uri nor jsonrpc_uri, api.env.server isn't set. Then another AttributeError exception is raised in ServerInfo constructor.
AttributeError
api.env.server
ServerInfo constructor
More than just the API uses these values, certmonger for example still requires xmlrpc_uri to be set.
I think for your use-case, this separate tool, is probably valid.
I'm concerned what might happen on an IPA client if default.conf is configured in this way.
Metadata Update from @rcritten: - Issue priority set to: normal - Issue set to the milestone: FreeIPA 4.7
Metadata Update from @rcritten: - Issue set to the milestone: FreeIPA 4.7.1 (was: FreeIPA 4.7)
FreeIPA 4.7 has been released, moving to FreeIPA 4.7.1 milestone
Metadata Update from @rcritten: - Issue set to the milestone: FreeIPA 4.7.2 (was: FreeIPA 4.7.1)
FreeIPA 4.7.1 has been released, moving to FreeIPA 4.7.2 milestone
It seems to me that the ipa client should be able to automatically determine the ipa servers. I recently discovered that the xmlrcp_uri on a client was pointing to an old server and so ipa commands would hang for a long time trying to access the dead server. Removing the server and xmlrpc_uri variables resulted in:
ipa: ERROR: AttributeError: 'Env' object has no attribute 'server' Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/ipalib/cli.py", line 1463, in run api.finalize() File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 739, in finalize self.__do_if_not_done('load_plugins') File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 431, in __do_if_not_done getattr(self, name)() File "/usr/lib/python2.7/site-packages/ipalib/plugable.py", line 619, in load_plugins for package in self.packages: File "/usr/lib/python2.7/site-packages/ipalib/__init__.py", line 949, in packages ipaclient.remote_plugins.get_package(self), File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 128, in get_package server_info = ServerInfo(api) File "/usr/lib/python2.7/site-packages/ipaclient/remote_plugins/__init__.py", line 34, in __init__ hostname = DNSName(api.env.server).ToASCII() AttributeError: 'Env' object has no attribute 'server' ipa: ERROR: an internal error has occurred