2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-23 01:53:28 +00:00

Add ntp to deploycfg data

This commit is contained in:
Jarrod Johnson 2020-07-09 11:35:11 -04:00
parent 771c3a2984
commit 2bfbfeb4d3
2 changed files with 14 additions and 1 deletions

View File

@ -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',
# },

View File

@ -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),))