diff options
author | Simo Sorce <simo@redhat.com> | 2015-07-15 13:14:35 -0400 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-10-15 14:24:33 +0200 |
commit | f7d1e4f9a21b0f3e63bd3bcd4a17acf749e0b208 (patch) | |
tree | 17e46575771630abe170134d42d74632d6c5922d /ipaserver/install/server | |
parent | d03619fff3a1eb7d21c2ba21f8867ae8018779b8 (diff) | |
download | freeipa-f7d1e4f9a21b0f3e63bd3bcd4a17acf749e0b208.tar.gz freeipa-f7d1e4f9a21b0f3e63bd3bcd4a17acf749e0b208.tar.xz freeipa-f7d1e4f9a21b0f3e63bd3bcd4a17acf749e0b208.zip |
Change DNS installer code to use passed in api
Fixes a number of places where api was not passed around internally.
Also allows to install dns in replica promotion which requires an
alternative api to be created with the right configuration.
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/install/server')
-rw-r--r-- | ipaserver/install/server/replicainstall.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 96fabddcc..13573f404 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -776,8 +776,6 @@ def promote_check(installer): raise NotImplementedError if options.setup_kra: raise NotImplementedError - if options.setup_dns: - raise NotImplementedError tasks.check_selinux_status() @@ -1040,7 +1038,6 @@ def promote_check(installer): raise RuntimeError("CA cert file is not available.") installer._ca_enabled = ca_enabled - installer._remote_api = remote_api installer._fstore = fstore installer._sstore = sstore installer._config = config @@ -1088,6 +1085,8 @@ def promote(installer): # or certmonger will fail to contact the peer master install_http_certs(config, fstore) + ldapi_uri = installutils.realm_to_ldapi_uri(config.realm_name) + # Create the management framework config file gopts = [ ipaconf.setOption('host', config.host_name), @@ -1095,8 +1094,7 @@ def promote(installer): ipaconf.setOption('xmlrpc_uri', 'https://%s/ipa/xml' % ipautil.format_netloc(config.host_name)), - ipaconf.setOption('ldap_uri', - installutils.realm_to_ldapi_uri(config.realm_name)), + ipaconf.setOption('ldap_uri', ldapi_uri), ipaconf.setOption('mode', 'production'), ipaconf.setOption('enable_ra', 'True'), ipaconf.setOption('ra_plugin', 'dogtag'), @@ -1155,10 +1153,6 @@ def promote(installer): dogtag_service = services.knownservices[dogtag_constants.SERVICE_NAME] dogtag_service.restart(dogtag_constants.PKI_INSTANCE_NAME) - if options.setup_dns: - api.Backend.ldap2.connect(autobind=True) - dns.install(False, True, options) - # Restart httpd to pick up the new IPA configuration service.print_msg("Restarting the web server") http.restart() @@ -1169,6 +1163,16 @@ def promote(installer): promote_sssd(config.host_name) + # Switch API so that it uses the new servr configuration + server_api = create_api(mode=None) + server_api.bootstrap(in_server=True, context='installer') + server_api.finalize() + + if options.setup_dns: + server_api.Backend.rpcclient.connect() + server_api.Backend.ldap2.connect(autobind=True) + dns.install(False, True, options, server_api) + # Everything installed properly, activate ipa service. services.knownservices.ipa.enable() |