Blob Blame History Raw
From 8110958d141392014bf3e3eae01654e7864d7647 Mon Sep 17 00:00:00 2001
From: Christian Heimes <cheimes@redhat.com>
Date: Tue, 10 Jul 2018 12:51:36 +0200
Subject: [PATCH] Fix DNSSEC install regression

7284097eedef70dd556270732e6ab8e23501ce09 introduced a regression in
DNSSEC master installation. For standalone and replica installation,
services have to be enabled before checking bind config.

Fixes: https://pagure.io/freeipa/issue/7635
See: https://pagure.io/freeipa/issue/7566
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
---
 install/tools/ipa-dns-install | 5 +----
 ipaserver/install/dns.py      | 5 +++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index 57dde5a5da4fad162c93e9e0416b54961de4c1e3..32a17d223ae2bdd9a1ded62defcc272a40d2627b 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -37,7 +37,6 @@ from ipapython.config import IPAOptionParser
 from ipapython.ipa_log_manager import standard_logging_setup
 
 from ipaserver.install import dns as dns_installer
-from ipaserver.install import service
 
 logger = logging.getLogger(os.path.basename(__file__))
 
@@ -149,9 +148,7 @@ def main():
 
     dns_installer.install_check(True, api, False, options, hostname=api.env.host)
     dns_installer.install(True, False, options)
-    # Enable configured services and update DNS SRV records
-    service.enable_services(api.env.host)
-    api.Command.dns_update_system_records()
+    # Services are enabled in dns_installer.install()
 
     # execute ipactl to refresh services status
     ipautil.run(['ipactl', 'start', '--ignore-service-failures'],
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index e14b353e9cb655a6e7ef228d47dfc7a1badd7286..cac7a9213796d6618854b12da6c2a7fe60afdbf9 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -44,6 +44,7 @@ from ipaserver.install import bindinstance
 from ipaserver.install import dnskeysyncinstance
 from ipaserver.install import odsexporterinstance
 from ipaserver.install import opendnssecinstance
+from ipaserver.install import service
 
 if six.PY3:
     unicode = str
@@ -357,6 +358,10 @@ def install(standalone, replica, options, api=api):
     dnskeysyncd.start_dnskeysyncd()
     bind.start_named()
 
+    # Enable configured services for standalone check_global_configuration()
+    if standalone:
+        service.enable_services(api.env.host)
+
     # this must be done when bind is started and operational
     bind.update_system_records()
 
-- 
2.17.1