diff --git a/roles/ipaclient/library/ipaclient_setup_ntp.py b/roles/ipaclient/library/ipaclient_setup_ntp.py index 6fb6b18e69c7910e768f30a6285574f93f7b8fa6..382f6b3184b8ad05db0a82990e4ff09d61ad9c5b 100644 --- a/roles/ipaclient/library/ipaclient_setup_ntp.py +++ b/roles/ipaclient/library/ipaclient_setup_ntp.py @@ -124,7 +124,12 @@ def main(): if sync_time is not None: if options.conf_ntp: # Attempt to configure and sync time with NTP server (chrony). - synced_ntp = sync_time(options, fstore, statestore) + argspec = inspect.getargspec(sync_time) + if "options" not in argspec.args: + synced_ntp = sync_time(options.ntp_servers, options.ntp_pool, + fstore, statestore) + else: + synced_ntp = sync_time(options, fstore, statestore) elif options.on_master: # If we're on master skipping the time sync here because it was done # in ipa-server-install diff --git a/roles/ipaclient/library/ipaclient_test.py b/roles/ipaclient/library/ipaclient_test.py index 3d6f4b65e772620762189810a19e82c0505b1604..f12bb563edc34d4931a3f3fd3db1d0c296cdc59f 100644 --- a/roles/ipaclient/library/ipaclient_test.py +++ b/roles/ipaclient/library/ipaclient_test.py @@ -492,9 +492,10 @@ def main(): try: timeconf.check_timedate_services() except timeconf.NTPConflictingService as e: - logger.info("WARNING: conflicting time&date synchronization service '{}'" - " will be disabled".format(e.conflicting_service)) - logger.info("in favor of chronyd") + logger.info( + "WARNING: conflicting time&date synchronization service " + "'%s' will be disabled in favor of chronyd" % \ + e.conflicting_service) logger.info("") except timeconf.NTPConfigurationError: pass @@ -800,6 +801,13 @@ def main(): # "Proceed with fixed values and no DNS discovery?", False): # raise ScriptError(rval=CLIENT_INSTALL_ERROR) + # Do not ask for time source + #if options.conf_ntp: + # if not options.on_master and not options.unattended and not ( + # options.ntp_servers or options.ntp_pool): + # options.ntp_servers, options.ntp_pool = \ + # timeconf.get_time_source() + cli_realm = ds.realm cli_realm_source = ds.realm_source logger.debug("will use discovered realm: %s", cli_realm) @@ -829,6 +837,14 @@ def main(): logger.info("BaseDN: %s", cli_basedn) logger.debug("BaseDN source: %s", cli_basedn_source) + if not options.on_master: + if options.ntp_servers: + for server in options.ntp_servers: + logger.info("NTP server: %s", server) + + if options.ntp_pool: + logger.info("NTP pool: %s", options.ntp_pool) + # ipa-join would fail with IP address instead of a FQDN for srv in cli_server: try: @@ -894,6 +910,8 @@ def main(): client_domain=client_domain, dnsok=dnsok, sssd=options.sssd, + ntp_servers=options.ntp_servers, + ntp_pool=options.ntp_pool, client_already_configured=client_already_configured, ipa_python_version=IPA_PYTHON_VERSION) diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml index 906a692598739e9254d4c68d80ed3445e90206dc..e66c46e10529f15c67afbd8f2183fed1bce9e0ff 100644 --- a/roles/ipaclient/tasks/install.yml +++ b/roles/ipaclient/tasks/install.yml @@ -63,8 +63,8 @@ - name: Install - Configure NTP ipaclient_setup_ntp: ### basic ### - ntp_servers: "{{ ipaclient_ntp_servers | default(omit) }}" - ntp_pool: "{{ ipaclient_ntp_pool | default(omit) }}" + ntp_servers: "{{ result_ipaclient_test.ntp_servers | default(omit) }}" + ntp_pool: "{{ result_ipaclient_test.ntp_pool | default(omit) }}" no_ntp: "{{ ipaclient_no_ntp }}" # force_ntpd: "{{ ipaclient_force_ntpd }}" on_master: "{{ ipaclient_on_master }}"