Skip to content
Snippets Groups Projects
Commit 658f8309 authored by Thomas Woerner's avatar Thomas Woerner
Browse files

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.
parent 40905510
Branches
Tags
No related merge requests found
...@@ -99,6 +99,7 @@ def main(): ...@@ -99,6 +99,7 @@ def main():
#force_ntpd=dict(required=False, type='bool', default=False), #force_ntpd=dict(required=False, type='bool', default=False),
on_master=dict(required=False, type='bool', default=False), on_master=dict(required=False, type='bool', default=False),
### additional ### ### additional ###
servers=dict(required=False, type='list', default=None),
domain=dict(required=False, default=None), domain=dict(required=False, default=None),
), ),
supports_check_mode = True, supports_check_mode = True,
...@@ -110,6 +111,7 @@ def main(): ...@@ -110,6 +111,7 @@ def main():
options.no_ntp = module.params.get('no_ntp') options.no_ntp = module.params.get('no_ntp')
#options.force_ntpd = module.params.get('force_ntpd') #options.force_ntpd = module.params.get('force_ntpd')
options.on_master = module.params.get('on_master') options.on_master = module.params.get('on_master')
cli_server = module.params.get('servers')
cli_domain = module.params.get('domain') cli_domain = module.params.get('domain')
options.conf_ntp = not options.no_ntp options.conf_ntp = not options.no_ntp
...@@ -138,7 +140,7 @@ def main(): ...@@ -138,7 +140,7 @@ def main():
# in the DNS. # in the DNS.
# If that fails, we try to sync directly with IPA server, # If that fails, we try to sync directly with IPA server,
# assuming it runs NTP # assuming it runs NTP
if len(options.ntp_servers) < 1: if not options.ntp_servers:
# Detect NTP servers # Detect NTP servers
ds = ipadiscovery.IPADiscovery() ds = ipadiscovery.IPADiscovery()
ntp_servers = ds.ipadns_search_srv(cli_domain, '_ntp._udp', ntp_servers = ds.ipadns_search_srv(cli_domain, '_ntp._udp',
......
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#force_ntpd: "{{ ipaclient_force_ntpd }}" #force_ntpd: "{{ ipaclient_force_ntpd }}"
on_master: "{{ ipaclient_on_master }}" on_master: "{{ ipaclient_on_master }}"
### additional ### ### additional ###
servers: "{{ result_ipaclient_test.servers }}"
domain: "{{ result_ipaclient_test.domain }}" domain: "{{ result_ipaclient_test.domain }}"
- name: Install - Test if IPA client has working krb5.keytab - name: Install - Test if IPA client has working krb5.keytab
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment