mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 05:43:26 +00:00
ipaclient_setup_ntp: Add missing cli_servers, fix options.ntp_servers check
cli_servers from ipaclient_test was missing in ipaclient_setup_ntp. This resulted in a backtrace and is fixed now. Fix options.ntp_servers check to not use length on NoneType.
This commit is contained in:
@@ -99,6 +99,7 @@ def main():
|
||||
#force_ntpd=dict(required=False, type='bool', default=False),
|
||||
on_master=dict(required=False, type='bool', default=False),
|
||||
### additional ###
|
||||
servers=dict(required=False, type='list', default=None),
|
||||
domain=dict(required=False, default=None),
|
||||
),
|
||||
supports_check_mode = True,
|
||||
@@ -110,6 +111,7 @@ def main():
|
||||
options.no_ntp = module.params.get('no_ntp')
|
||||
#options.force_ntpd = module.params.get('force_ntpd')
|
||||
options.on_master = module.params.get('on_master')
|
||||
cli_server = module.params.get('servers')
|
||||
cli_domain = module.params.get('domain')
|
||||
|
||||
options.conf_ntp = not options.no_ntp
|
||||
@@ -138,7 +140,7 @@ def main():
|
||||
# in the DNS.
|
||||
# If that fails, we try to sync directly with IPA server,
|
||||
# assuming it runs NTP
|
||||
if len(options.ntp_servers) < 1:
|
||||
if not options.ntp_servers:
|
||||
# Detect NTP servers
|
||||
ds = ipadiscovery.IPADiscovery()
|
||||
ntp_servers = ds.ipadns_search_srv(cli_domain, '_ntp._udp',
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
#force_ntpd: "{{ ipaclient_force_ntpd }}"
|
||||
on_master: "{{ ipaclient_on_master }}"
|
||||
### additional ###
|
||||
servers: "{{ result_ipaclient_test.servers }}"
|
||||
domain: "{{ result_ipaclient_test.domain }}"
|
||||
|
||||
- name: Install - Test if IPA client has working krb5.keytab
|
||||
|
||||
Reference in New Issue
Block a user