mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Log interactive options in install scripts
This commit is contained in:
parent
53d1553755
commit
d9dd838014
@ -87,6 +87,7 @@ def main():
|
||||
print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log"
|
||||
|
||||
logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
|
||||
logging.debug("missing options might be asked for interactively later\n")
|
||||
|
||||
global fstore
|
||||
fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
|
||||
@ -127,6 +128,7 @@ def main():
|
||||
return 1
|
||||
else:
|
||||
ip_address = read_ip_address(api.env.host, fstore)
|
||||
logging.debug("will use ip_address: %s\n", ip_address)
|
||||
|
||||
if options.no_forwarders:
|
||||
dns_forwarders = ()
|
||||
@ -134,6 +136,7 @@ def main():
|
||||
dns_forwarders = options.forwarders
|
||||
else:
|
||||
dns_forwarders = read_dns_forwarders()
|
||||
logging.debug("will use dns_forwarders: %s\n", str(dns_forwarders))
|
||||
|
||||
if not options.dm_password:
|
||||
dm_password = read_password("Directory Manager", confirm=False, validate=False)
|
||||
|
@ -467,6 +467,7 @@ def main():
|
||||
sys.exit("IPA server is already configured on this system.")
|
||||
|
||||
logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
|
||||
logging.debug("missing options might be asked for interactively later\n")
|
||||
|
||||
global fstore
|
||||
fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
|
||||
@ -565,9 +566,11 @@ def main():
|
||||
host_name = read_host_name(host_default,options.no_host_dns)
|
||||
|
||||
host_name = host_name.lower()
|
||||
logging.debug("will use host_name: %s\n" % host_name)
|
||||
|
||||
if not options.domain_name:
|
||||
domain_name = read_domain_name(host_name[host_name.find(".")+1:], options.unattended)
|
||||
logging.debug("read domain_name: %s\n" % domain_name)
|
||||
else:
|
||||
domain_name = options.domain_name
|
||||
|
||||
@ -603,6 +606,7 @@ def main():
|
||||
|
||||
if not ip:
|
||||
ip = read_ip_address(host_name, fstore)
|
||||
logging.debug("read ip_address: %s\n" % ip)
|
||||
ip_address = ip
|
||||
|
||||
print "The IPA Master Server will be configured with"
|
||||
@ -615,11 +619,13 @@ def main():
|
||||
ds_user = read_ds_user()
|
||||
if ds_user == "":
|
||||
return 1
|
||||
logging.debug("read ds_user: %s\n" % ds_user)
|
||||
else:
|
||||
ds_user = options.ds_user
|
||||
|
||||
if not options.realm_name:
|
||||
realm_name = read_realm_name(domain_name, options.unattended)
|
||||
logging.debug("read realm_name: %s\n" % realm_name)
|
||||
else:
|
||||
realm_name = options.realm_name.upper()
|
||||
|
||||
@ -650,6 +656,7 @@ def main():
|
||||
dns_forwarders = read_dns_forwarders()
|
||||
else:
|
||||
dns_forwarders = ()
|
||||
logging.debug("will use dns_forwarders: %s\n" % str(dns_forwarders))
|
||||
|
||||
# Create the management framework config file and finalize api
|
||||
fd = open("/etc/ipa/default.conf", "w")
|
||||
|
@ -504,6 +504,7 @@ def main():
|
||||
safe_options, options = parse_options()
|
||||
logging_setup(options)
|
||||
logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
|
||||
logging.debug("missing options might be asked for interactively later\n")
|
||||
dnsok = False
|
||||
env={"PATH":"/bin:/sbin:/usr/kerberos/bin:/usr/kerberos/sbin:/usr/bin:/usr/sbin"}
|
||||
|
||||
@ -547,6 +548,7 @@ def main():
|
||||
else:
|
||||
print "DNS discovery failed to determine your DNS domain"
|
||||
cli_domain = user_input("Please provide the domain name of your IPA server (ex: example.com)", allow_empty = False)
|
||||
logging.debug("will use domain: %s\n", cli_domain)
|
||||
if options.on_master:
|
||||
ret = ds.search(domain=options.domain, server=options.server)
|
||||
else:
|
||||
@ -554,6 +556,7 @@ def main():
|
||||
if not cli_domain:
|
||||
if ds.getDomainName():
|
||||
cli_domain = ds.getDomainName()
|
||||
logging.debug("will use domain: %s\n", cli_domain)
|
||||
|
||||
if ret == -2 or not ds.getServerName():
|
||||
logging.debug("IPA Server not found")
|
||||
@ -564,12 +567,14 @@ def main():
|
||||
else:
|
||||
print "DNS discovery failed to find the IPA Server"
|
||||
cli_server = user_input("Please provide your IPA server name (ex: ipa.example.com)", allow_empty = False)
|
||||
logging.debug("will use server: %s\n", cli_server)
|
||||
ret = ds.search(domain=cli_domain, server=cli_server)
|
||||
else:
|
||||
dnsok = True
|
||||
if not cli_server:
|
||||
if ds.getServerName():
|
||||
cli_server = ds.getServerName()
|
||||
logging.debug("will use server: %s\n", cli_server)
|
||||
|
||||
if ret != 0:
|
||||
print "Failed to verify that "+cli_server+" is an IPA Server."
|
||||
@ -595,7 +600,9 @@ def main():
|
||||
return -3
|
||||
|
||||
cli_realm = ds.getRealmName()
|
||||
logging.debug("will use cli_realm: %s\n", cli_realm)
|
||||
cli_basedn = ds.getBaseDN()
|
||||
logging.debug("will use cli_basedn: %s\n", cli_basedn)
|
||||
subject_base = "O=%s" % ds.getRealmName()
|
||||
|
||||
print "Realm: "+cli_realm
|
||||
@ -610,6 +617,7 @@ def main():
|
||||
if not options.unattended:
|
||||
if options.principal is None and options.password is None and options.prompt_password is False:
|
||||
options.principal = user_input("Enrollment principal", allow_empty=False)
|
||||
logging.debug("will use principal: %s\n", options.principal)
|
||||
|
||||
# Get the CA certificate
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user