diff options
author | Martin Basti <mbasti@redhat.com> | 2015-11-23 13:43:53 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2015-12-02 17:20:19 +0100 |
commit | efeb7d54ba7e3145a7a0b50c4b275d208cb656e6 (patch) | |
tree | 2d7b43b8298cd759da7e6d1786940b2ef83f1610 | |
parent | 17f9ca154b47f1e21797d25435e25676fdca284c (diff) | |
download | freeipa-efeb7d54ba7e3145a7a0b50c4b275d208cb656e6.tar.gz freeipa-efeb7d54ba7e3145a7a0b50c4b275d208cb656e6.tar.xz freeipa-efeb7d54ba7e3145a7a0b50c4b275d208cb656e6.zip |
ipa-kra-install: allow to install first KRA on replica
https://fedorahosted.org/freeipa/ticket/5460
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
-rw-r--r-- | ipaserver/install/krainstance.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ipaserver/install/krainstance.py b/ipaserver/install/krainstance.py index d58bcc659..6589bb54e 100644 --- a/ipaserver/install/krainstance.py +++ b/ipaserver/install/krainstance.py @@ -219,18 +219,13 @@ class KRAInstance(DogtagInstance): str(DN(('uid', 'pkidbuser'), ('ou', 'people'), ('o', 'ipaca')))) _p12_tmpfile_handle, p12_tmpfile_name = tempfile.mkstemp(dir=paths.TMP) + if self.clone: krafile = self.pkcs12_info[0] shutil.copy(krafile, p12_tmpfile_name) pent = pwd.getpwnam(PKI_USER) os.chown(p12_tmpfile_name, pent.pw_uid, pent.pw_gid) - # FIXME - # # create admin cert file if it does not exist - # cert = DogtagInstance.get_admin_cert(self) - # with open(paths.ADMIN_CERT_PATH, "w") as admin_path: - # admin_path.write(cert) - # Security domain registration config.set("KRA", "pki_security_domain_hostname", self.master_host) config.set("KRA", "pki_security_domain_https_port", "443") @@ -246,6 +241,11 @@ class KRAInstance(DogtagInstance): config.set( "KRA", "pki_clone_uri", "https://%s" % ipautil.format_netloc(self.master_host, 443)) + else: + # the admin cert file is needed for the first instance of KRA + cert = DogtagInstance.get_admin_cert(self) + with open(paths.ADMIN_CERT_PATH, "w") as admin_path: + admin_path.write(cert) # Generate configuration file with open(cfg_file, "wb") as f: |