mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
DNS: check if DNS package is installed
Instead of separate checking of DNS required packages, we need just check if IPA DNS package is installed. https://fedorahosted.org/freeipa/ticket/4058 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
a487e42d3f
commit
92828d3cf5
@@ -8,4 +8,4 @@ This base platform module exports platform dependant constants.
|
||||
|
||||
|
||||
class BaseConstantsNamespace(object):
|
||||
pass
|
||||
IPA_DNS_PACKAGE_NAME = "freeipa-server-dns"
|
||||
|
||||
@@ -218,6 +218,7 @@ class BasePathNamespace(object):
|
||||
GROUPADD = "/usr/sbin/groupadd"
|
||||
HTTPD = "/usr/sbin/httpd"
|
||||
IPA_CLIENT_INSTALL = "/usr/sbin/ipa-client-install"
|
||||
IPA_DNS_INSTALL = "/usr/sbin/ipa-dns-install"
|
||||
SBIN_IPA_JOIN = "/usr/sbin/ipa-join"
|
||||
IPA_REPLICA_CONNCHECK = "/usr/sbin/ipa-replica-conncheck"
|
||||
IPA_RMKEYTAB = "/usr/sbin/ipa-rmkeytab"
|
||||
|
||||
@@ -11,6 +11,6 @@ from ipaplatform.redhat.constants import RedHatConstantsNamespace
|
||||
|
||||
|
||||
class RHELConstantsNamespace(RedHatConstantsNamespace):
|
||||
pass
|
||||
IPA_DNS_PACKAGE_NAME = "ipa-server-dns"
|
||||
|
||||
constants = RHELConstantsNamespace()
|
||||
|
||||
@@ -62,25 +62,8 @@ named_conf_arg_options_template_nonstr = "%(indent)s%(name)s %(value)s;\n"
|
||||
named_conf_include_re = re.compile(r'\s*include\s+"(?P<path>)"\s*;')
|
||||
named_conf_include_template = "include \"%(path)s\";\n"
|
||||
|
||||
|
||||
def check_inst(unattended):
|
||||
has_bind = True
|
||||
named = services.knownservices.named
|
||||
if not os.path.exists(named.get_binary_path()):
|
||||
print "BIND was not found on this system"
|
||||
print ("Please install the '%s' package and start the installation again"
|
||||
% named.get_package_name())
|
||||
has_bind = False
|
||||
|
||||
# Also check for the LDAP BIND plug-in
|
||||
if not os.path.exists(paths.BIND_LDAP_SO) and \
|
||||
not os.path.exists(paths.BIND_LDAP_SO_64):
|
||||
print "The BIND LDAP plug-in was not found on this system"
|
||||
print "Please install the 'bind-dyndb-ldap' package and start the installation again"
|
||||
has_bind = False
|
||||
|
||||
if not has_bind:
|
||||
return False
|
||||
|
||||
if not unattended and os.path.exists(NAMED_CONF):
|
||||
msg = "Existing BIND configuration detected, overwrite?"
|
||||
return ipautil.user_input(msg, False)
|
||||
|
||||
@@ -9,6 +9,7 @@ from subprocess import CalledProcessError
|
||||
from ipalib import api
|
||||
from ipalib import errors
|
||||
from ipaplatform.paths import paths
|
||||
from ipaplatform.constants import constants
|
||||
from ipaplatform import services
|
||||
from ipapython import ipautil
|
||||
from ipapython import sysrestore
|
||||
@@ -96,6 +97,10 @@ def install_check(standalone, replica, options, hostname):
|
||||
global reverse_zones
|
||||
fstore = sysrestore.FileStore(paths.SYSRESTORE)
|
||||
|
||||
if not ipautil.file_exists(paths.IPA_DNS_INSTALL):
|
||||
raise RuntimeError("Integrated DNS requires '%s' package" %
|
||||
constants.IPA_DNS_PACKAGE_NAME)
|
||||
|
||||
if standalone:
|
||||
print "=============================================================================="
|
||||
print "This program will setup DNS for the FreeIPA Server."
|
||||
@@ -141,8 +146,7 @@ def install_check(standalone, replica, options, hostname):
|
||||
sys.exit("Aborted")
|
||||
|
||||
# Check bind packages are installed
|
||||
if not (bindinstance.check_inst(options.unattended) and
|
||||
dnskeysyncinstance.check_inst()):
|
||||
if not bindinstance.check_inst(options.unattended):
|
||||
sys.exit("Aborting installation.")
|
||||
|
||||
if options.disable_dnssec_master:
|
||||
@@ -177,9 +181,6 @@ def install_check(standalone, replica, options, hostname):
|
||||
sys.exit("Only one DNSSEC key master is supported in current "
|
||||
"version.")
|
||||
|
||||
# check opendnssec packages are installed
|
||||
if not opendnssecinstance.check_inst():
|
||||
sys.exit("Aborting installation")
|
||||
if options.kasp_db_file:
|
||||
dnskeysyncd = services.service('ipa-dnskeysyncd')
|
||||
|
||||
|
||||
@@ -30,12 +30,6 @@ softhsm_token_label = u'ipaDNSSEC'
|
||||
softhsm_slot = 0
|
||||
replica_keylabel_template = u"dnssec-replica:%s"
|
||||
|
||||
def check_inst():
|
||||
if not os.path.exists(paths.DNSSEC_KEYFROMLABEL):
|
||||
print ("Please install the 'bind-pkcs11-utils' package and start "
|
||||
"the installation again")
|
||||
return False
|
||||
return True
|
||||
|
||||
def dnssec_container_exists(fqdn, suffix, dm_password=None, ldapi=False,
|
||||
realm=None, autobind=ipaldap.AUTOBIND_DISABLED):
|
||||
|
||||
@@ -55,14 +55,6 @@ def get_dnssec_key_masters(conn):
|
||||
return keymasters_list
|
||||
|
||||
|
||||
def check_inst():
|
||||
if not os.path.exists(paths.ODS_KSMUTIL):
|
||||
print ("Please install the 'opendnssec' package and start "
|
||||
"the installation again")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class OpenDNSSECInstance(service.Service):
|
||||
def __init__(self, fstore=None, dm_password=None, ldapi=False,
|
||||
start_tls=False, autobind=ipaldap.AUTOBIND_ENABLED):
|
||||
|
||||
Reference in New Issue
Block a user