diff --git a/confluent_server/confluent/config/attributes.py b/confluent_server/confluent/config/attributes.py index e4b5ccf6..3b497497 100644 --- a/confluent_server/confluent/config/attributes.py +++ b/confluent_server/confluent/config/attributes.py @@ -443,6 +443,12 @@ node = { 'See information on net.switch for more on the ' 'flexibility of net.* attributes.' }, + 'ntp.servers': { + 'description': 'NTP server or servers to provide to node during ' + 'deployment. An OS profile may default to internet NTP, ' + 'depending on default configuration of the respective ' + 'operating system', + }, # 'id.modelnumber': { # 'description': 'The manufacturer dictated model number for the node', # }, diff --git a/confluent_server/confluent/selfservice.py b/confluent_server/confluent/selfservice.py index ecda26d9..f565cab0 100644 --- a/confluent_server/confluent/selfservice.py +++ b/confluent_server/confluent/selfservice.py @@ -73,7 +73,7 @@ def handle_request(env, start_response): ncfg['ipv4_netmask'] = netutil.cidr_to_mask(ncfg['prefix']) deployinfo = cfg.get_node_attributes( nodename, ('deployment.*', 'console.method', 'crypted.*', - 'dns.*')) + 'dns.*', 'ntp.*')) deployinfo = deployinfo.get(nodename, {}) profile = deployinfo.get( 'deployment.pendingprofile', {}).get('value', '') @@ -136,6 +136,13 @@ def handle_request(env, start_response): for dns in deployinfo.get( 'dns.servers', {}).get('value', '').split(','): ncfg['nameservers'].append(dns) + ntpsrvs = deployinfo.get('ntp.servers', {}).get('value', '') + if ntpsrvs: + ntpsrvs = ntpsrvs.split(',') + if ntpsrvs: + ncfg['ntpservers'] = [] + for ntpsrv in ntpsrvs: + ncfg['ntpservers'].append(ntpsrv) dnsdomain = deployinfo.get('dns.domain', {}).get('value', None) ncfg['dnsdomain'] = dnsdomain start_response('200 OK', (('Content-Type', retype),))