From e55d8ee5d4649b2fd35aa6f29ed2a8f60088d1a8 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Wed, 15 Apr 2015 14:32:17 +0200 Subject: [PATCH] ipa client: use NTP servers detected from SRV Detected NTP servers from SRV records should be used in NTP client configuration. https://fedorahosted.org/freeipa/ticket/4981 Reviewed-By: Martin Babinsky --- ipa-client/ipa-install/ipa-client-install | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index b3444cf9b..43d5ae8dc 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -2340,6 +2340,7 @@ def install(options, env, fstore, statestore): # hostname if different from system hostname tasks.backup_and_replace_hostname(fstore, statestore, options.hostname) + ntp_srv_servers = [] if not options.on_master and options.conf_ntp: # Attempt to sync time with IPA server. # If we're skipping NTP configuration, we also skip the time sync here. @@ -2852,10 +2853,16 @@ def install(options, env, fstore, statestore): # disable other time&date services first if options.force_ntpd: ipaclient.ntpconf.force_ntpd(statestore) - if options.ntp_servers: + + if options.ntp_server: ntp_servers = options.ntp_servers + elif ntp_srv_servers: + ntp_servers = ntp_srv_servers else: + root_logger.warning("No SRV records of NTP servers found. IPA " + "server address will be used") ntp_servers = cli_server + ipaclient.ntpconf.config_ntp(ntp_servers, fstore, statestore) root_logger.info("NTP enabled")